Skip to content

Instantly share code, notes, and snippets.

// Validator method
#[ink(message)]
pub fn request_swap(&mut self, transfer_info: SwapMessage) {
let caller: AccountId = self.env().caller();
assert!(self.validators.get(&caller).is_some(), "Only Validator can send requests to swap assets");
assert!(transfer_info.chain_id == self.chain_id, "Swap request's chain ID doesn't match contract's chain ID");
assert!(self.check_expiration_time(transfer_info.timestamp.clone()), "Transaction can't be sent because of expiration time");
import Web3 from "web3";
import config from "./Config";
const getWeb3 = () =>
new Promise((resolve, reject) => {
// Wait for loading completion to avoid race conditions with web3 injection timing.
window.addEventListener("load", async () => {
// Modern dapp browsers...
if (window.ethereum) {
const web3 = new Web3(window.ethereum);

kaykorobey

Keybase proof

I hereby claim:

  • I am koroqe on github.
  • I am kaykorobey (https://keybase.io/kaykorobey) on keybase.
  • I have a public key ASC7B1SIONZNpWhxIG-aLUM6efcj_RuQtFJZbfcwYzjosQo

To claim this, I am signing this object:

@Koroqe
Koroqe / Int20hCrowdsale.sol
Created January 23, 2018 20:54
Crowdsale smart-contract for Int20h hackaton 2018
pragma solidity ^0.4.16;
interface token {
function transfer(address receiver, uint amount);
}
contract Int20hToken {
address public owner; // владелец контракта
@Koroqe
Koroqe / Int20hToken.sol
Created January 23, 2018 20:53
Token smart-contract for Int20h hackaton 2018
pragma solidity ^0.4.16;
library SafeMath {
// Библиотека для математических операций с проверкой uint256 overflow
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
pragma solidity 0.4.18;
contract SomeoneLendings {
function SomeoneLendings() {
someone = msg.sender; //define owner
}
address someone; //owner
mapping(address => uint) debts;