Contract 0x1A2a1c938CE3eC39b6D47113c7955bAa9DD454F2 9

 
To deposit assets into the Ronin sidechain, users need to interact with the Ronin smart contract. Simply transferring assets to the contract address results in permanent loss of funds.
Txn Hash Method
Block
From
To
Value
0xd019218af9ca7ea75282f8c4785a0df83c53e210fdacdf91f92b3adff7ca5981Withdraw ERC20Fo...(pending)2021-08-05 9:09:462 secs ago0x206b197fc8c7fa8e2b8da6b02ddbe2e11f25b032 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x4132c37343d8c2425ff57d72c6401865cf16b54b33c6b125fa1d0d21665bd823Deposit Eth For(pending)2021-08-05 9:09:462 secs ago0x323880863f00fd4e0af3e3780024706fc205a64d IN Axie Infinity: Ronin Bridge0.13 Ether(Pending)(Pending)
0xaf69ecab2056d441c121c72c808df181de42e806ecd07737a7ee90c49852c205Deposit Eth For(pending)2021-08-05 9:09:417 secs ago0xa1ddc87a803656a75f089835da534918edca9ab1 IN Axie Infinity: Ronin Bridge0.4 Ether(Pending)(Pending)
0x5a213c588df19417cfd8965025d512d8f7169e87036bc675aaf8eed5ef630c0cWithdraw ERC20Fo...(pending)2021-08-05 9:09:417 secs ago0x3e2034133f49d8cdaf1ca5238868209c86609643 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x62de47a6c51d00e210af00f74dc8c3571a7a082fd3342f3839984f4b6ec62aa0Deposit Eth For(pending)2021-08-05 9:09:417 secs ago0x87163041b908685c63a1599a224bc8e0fd9fdf2d IN Axie Infinity: Ronin Bridge0.48 Ether(Pending)(Pending)
0x03752319eed4776197b27b2cb6dc6559125488fc39bf64be4beb2bbc83700860Withdraw ERC20Fo...(pending)2021-08-05 9:09:417 secs ago0x9ac2fde4bdb2004352f27f63b8fd2672397c67f1 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x5f7b5fd5a646f9c108cf22cdbd4c8ad55023d116f9c70bb35aecacd5eb178e4bDeposit Eth For(pending)2021-08-05 9:09:417 secs ago0x6900c0af6cf5dbedad98d2fbfed8bd8ad013529f IN Axie Infinity: Ronin Bridge0.26 Ether(Pending)(Pending)
0xe8d871f666377982221d7416c646787fe7f776e64cca0de343f6b1080c99931dDeposit ERC20For(pending)2021-08-05 9:09:417 secs ago0xb4288be10ada671825a82c524b478da4d17a14f9 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x0f25452e91b953b8c4da6fb493bac3f7a7594ecc5c35ac1264ce24631ad09d2cWithdraw ERC20Fo...(pending)2021-08-05 9:09:417 secs ago0xab86c6a837760de9b0c5fb7b74f926c73e5595c8 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0xf7bad212f03e9a8f27579ddda97b8a756d73c54f21cc2cd0fb5eb7c485b6abf5Withdraw ERC20Fo...(pending)2021-08-05 9:09:3612 secs ago0xc885dad7953b848f015ebe7b2cb52327aa1f2ae3 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0xfeeffe2cc6bca0f4130c3d01a9a7e7d79051a9c82caf4bc4ffc1de0c5cdfa261Transfer(pending)2021-08-05 9:09:2622 secs ago0xddb12d5c692c36641bf1ccd852698256d4f6dee3 IN Axie Infinity: Ronin Bridge0.001 Ether(Pending)(Pending)
0x10b248479688cd6577716560ce6a49ce306cd48ed4c6466934a13b9619fb458cDeposit Eth For(pending)2021-08-05 9:08:371 min ago0x31dc4d25227561077d063a8b5d01931104a0c265 IN Axie Infinity: Ronin Bridge0.19 Ether(Pending)(Pending)
0x93ca0e9907e2566a1edb6995b4fcabd18bab70c2af048ed8b4b22edd8e0c2371Withdraw ERC20Fo...(pending)2021-08-05 9:08:311 min ago0x09f1c5a8c83b3917d436a5fc7fcf781d88c208c7 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x07aaacb7543539e08c182d4fa127e3d30d6aeb8b17a62e4b9cbbd0c98a1e1e34Withdraw ERC20Fo...(pending)2021-08-05 9:08:311 min ago0x09f1c5a8c83b3917d436a5fc7fcf781d88c208c7 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x22035255616b50bf0c7b95cdef8ba4107778b0790f98fbf96ef1be35a8b1e82aWithdraw ERC20Fo...(pending)2021-08-05 9:08:311 min ago0x09f1c5a8c83b3917d436a5fc7fcf781d88c208c7 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x29ed32e24283c12663aa3b84019c5134c6c04c1b395ab84fc0a42105fb339b26Withdraw ERC20Fo...(pending)2021-08-05 9:08:311 min ago0x09f1c5a8c83b3917d436a5fc7fcf781d88c208c7 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x007c6ada0b7edb6f00568ece0dc15b4db027184635774ee330d6b762b8b34a1dWithdraw ERC20Fo...(pending)2021-08-05 9:08:311 min ago0x09f1c5a8c83b3917d436a5fc7fcf781d88c208c7 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x3dd4a6eace66554b518ba8b111a0fdf1b34bd418e633293d10acd2c032016afaWithdraw ERC20Fo...(pending)2021-08-05 9:08:311 min ago0xb7340ee2fe6f547bf50d925fa77abaf039ab8564 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x104c5fe0b081c7a608c74ad3bad8a723f07be9979885baa534cc7d34d58baf50Withdraw ERC20Fo...(pending)2021-08-05 9:08:261 min ago0x04be31b86c89832fc1ae0a6c16720832e9ce905c IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x7403e74aeb0d97d91844500a44ef21facdb528a8ff275b821d6ea1b7edaca807Withdraw ERC20Fo...(pending)2021-08-05 9:08:211 min ago0x7c2b18b08cc0cc335df091cdf88afc903d05023e IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x8c9ccfc4e376243844ac7443901ea834f9e4a6487ee46ec3524c0c34a5508810Withdraw ERC20Fo...(pending)2021-08-05 9:08:071 min ago0x55d30664d0a4c1e8165e993886864656b1355f4c IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x9aa674d657e16e6f5b58f947cc376ee6d27951412a59ed5ac2822c45fdb6a872Withdraw ERC20Fo...(pending)2021-08-05 9:07:362 mins ago0xd3fe7db9ec2d93bc09d7bae979c2e800db63c1c1 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x1a1ee9e7e89aa5e69d068e29dc37059d35b4d350f560cbf02c03ccbce970b019Withdraw ERC20Fo...(pending)2021-08-05 9:07:172 mins ago0xcfc5867aa853823d7566bcb2ee03b7cf5725c34e IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x2feeec190e056f8dcbed3f33dd5e43e0584415d843e3fb02e0d03297312ce555Withdraw ERC20Fo...(pending)2021-08-05 9:07:172 mins ago0xa2ddda89f3229671aef6d7a5677e1a34eb922d00 IN Axie Infinity: Ronin Bridge0 Ether(Pending)(Pending)
0x8952e1ed851e65c91328736be3c062b97a13908c4be0ea137d3607b90cca47b9Deposit Eth For(pending)2021-08-05 9:07:022 mins ago0x3f9de693921e5e1d18ffda2a62d6ce90efdc3c2f IN Axie Infinity: Ronin Bridge0.659 Ether(Pending)(Pending)
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x1affb265fb012e07d8b49541a2c1dd5cb157b4f7bc2fcb3a305ccdaf5d88efa9129640752021-08-05 9:09:2523 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.64056 Ether
0xafeb0f73be933e4fa8ba2ac33b765f438793eb63e70e6f225d24081a69a85fa0129640752021-08-05 9:09:2523 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.918 Ether
0x0f0e802236464527176886b420ae68a451ded6ecb9a3acfed3b5eb90378e6711129640752021-08-05 9:09:2523 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.09 Ether
0x3a40663028a5edcd0b32ae86a70ee445ae46b8e69030eb8c3bb857ef10ddbaca129640752021-08-05 9:09:2523 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.3 Ether
0xab66afd7b568160e006c44e67c415b9b548d18452c33253991bcdb3b20bb811f129640752021-08-05 9:09:2523 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.656 Ether
0xc295ffdf87c1a0df828563105f264af50c89f64c14577142a85e014a037ef8ae129640752021-08-05 9:09:2523 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.27 Ether
0x4f904f0856194e0330a52b0e254724d1b47ab227b5eb7ab715717771efc64111129640752021-08-05 9:09:2523 secs ago Axie Infinity: Ronin Bridge0xb195ca3c0453e25aaca6bd4ef45d416d26a45d060.000986 Ether
0x4f904f0856194e0330a52b0e254724d1b47ab227b5eb7ab715717771efc64111129640752021-08-05 9:09:2523 secs ago Wrapped Ether Axie Infinity: Ronin Bridge0.000986 Ether
0x2f028ce0439e70b6dbcc00bd119cb470a408a657c85860208860883006beee08129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.544 Ether
0x8d1228561363a3c75473ab4a88f895e3573c769f65c4d7bf34c3bc6d323100b7129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether1.1462 Ether
0x029b4b0e04abfc55a712b564a2466759e1cd8a9bc363885c335bc18e964f3cd2129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.07 Ether
0x06b09b8810c4f7f972c42be7eb28faf682c5a1e40ff5b01d0b6cdb65e7b66eff129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.0218 Ether
0x664c67280edd7746e042425c83d87bcd2af0eb22bdba1e83e46afc3352aab9d8129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.28 Ether
0x256069e8e79aa56318ab169569ce448e4fad17a1c81c83c8d15137b72a5d93fe129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.585 Ether
0xc444bad45c78d519525746ddcc39f7a7883ff6231ac4d15f5b6abc0a6fda7578129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge0x5cf889bcf7d93d54712f8205f288593d7246efae0.6605 Ether
0xc444bad45c78d519525746ddcc39f7a7883ff6231ac4d15f5b6abc0a6fda7578129640742021-08-05 9:09:2424 secs ago Wrapped Ether Axie Infinity: Ronin Bridge0.6605 Ether
0x8a519632c2e37ac4f21466c91b0d5a98caaeb453aac443af35cceeae2cfee2de129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether1.535 Ether
0x4fac8e1e436ab63e160bd76c935245209231fa163ff445ae9b874dae0cf70361129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.21 Ether
0x993aadbb052594306c81f67e9cdc1b3d085255a26d5ffc5d22ebd0a27456ac40129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.082037654 Ether
0xbc447f47ef5af584ac88de80018f9d47220a18392b5d09e6f57ee6973b4ab337129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.252 Ether
0x1b227183b8cf5ba5c4fe74b85787e9d759460930c27e3986d6a3f67a0f00b310129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.04 Ether
0x160fc070e59ee251ffef8464c658c3273911aac91977848ba95af1be7d1e9082129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.132 Ether
0x3999d7349b9e8b6b679edf74a3a86979c53999edac32e484ad3f23647b6531ab129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge Wrapped Ether0.3559948019 Ether
0x979085422109786392666b425689d04d2680845812bd98373e082c3b8bc4c93a129640742021-08-05 9:09:2424 secs ago Axie Infinity: Ronin Bridge0xd7f209a6d8964452c5bbcdf87ea70b91f5325d700.047285590277777777 Ether
0x979085422109786392666b425689d04d2680845812bd98373e082c3b8bc4c93a129640742021-08-05 9:09:2424 secs ago Wrapped Ether Axie Infinity: Ronin Bridge0.047285590277777777 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MainchainGatewayProxy

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-04-28
*/

// File: @axie/contract-library/contracts/access/HasAdmin.sol

pragma solidity ^0.5.2;


contract HasAdmin {
  event AdminChanged(address indexed _oldAdmin, address indexed _newAdmin);
  event AdminRemoved(address indexed _oldAdmin);

  address public admin;

  modifier onlyAdmin {
    require(msg.sender == admin);
    _;
  }

  constructor() internal {
    admin = msg.sender;
    emit AdminChanged(address(0), admin);
  }

  function changeAdmin(address _newAdmin) external onlyAdmin {
    require(_newAdmin != address(0));
    emit AdminChanged(admin, _newAdmin);
    admin = _newAdmin;
  }

  function removeAdmin() external onlyAdmin {
    emit AdminRemoved(admin);
    admin = address(0);
  }
}

// File: @axie/contract-library/contracts/proxy/ProxyStorage.sol

pragma solidity ^0.5.2;

/**
 * @title ProxyStorage
 * @dev Store the address of logic contact that the proxy should forward to.
 */
contract ProxyStorage is HasAdmin {
  address internal _proxyTo;
}

// File: @axie/contract-library/contracts/proxy/Proxy.sol

pragma solidity ^0.5.2;


/**
 * @title Proxy
 * @dev Gives the possibility to delegate any call to a foreign implementation.
 */
contract Proxy is ProxyStorage {

  event ProxyUpdated(address indexed _new, address indexed _old);

  constructor(address _proxyTo) public {
    updateProxyTo(_proxyTo);
  }

  /**
  * @dev Tells the address of the implementation where every call will be delegated.
  * @return address of the implementation to which it will be delegated
  */
  function implementation() public view returns (address) {
    return _proxyTo;
  }

  /**
  * @dev See more at: https://eips.ethereum.org/EIPS/eip-897
  * @return type of proxy - always upgradable
  */
  function proxyType() external pure returns (uint256) {
      // Upgradeable proxy
      return 2;
  }

  /**
  * @dev Fallback function allowing to perform a delegatecall to the given implementation.
  * This function will return whatever the implementation call returns
  */
  function () payable external {
    address _impl = implementation();
    require(_impl != address(0));

    assembly {
      let ptr := mload(0x40)
      calldatacopy(ptr, 0, calldatasize)
      let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0)
      let size := returndatasize
      returndatacopy(ptr, 0, size)

      switch result
      case 0 { revert(ptr, size) }
      default { return(ptr, size) }
    }
  }

  function updateProxyTo(address _newProxyTo) public onlyAdmin {
    require(_newProxyTo != address(0x0));

    _proxyTo = _newProxyTo;
    emit ProxyUpdated(_newProxyTo, _proxyTo);
  }
}

// File: @axie/contract-library/contracts/lifecycle/Pausable.sol

pragma solidity ^0.5.2;



contract Pausable is HasAdmin {
  event Paused();
  event Unpaused();

  bool public paused;

  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  modifier whenPaused() {
    require(paused);
    _;
  }

  function pause() public onlyAdmin whenNotPaused {
    paused = true;
    emit Paused();
  }

  function unpause() public onlyAdmin whenPaused {
    paused = false;
    emit Unpaused();
  }
}

// File: @axie/contract-library/contracts/math/SafeMath.sol

pragma solidity ^0.5.2;


library SafeMath {
  function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
    c = a + b;
    require(c >= a);
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
    require(b <= a);
    return a - b;
  }

  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
    if (a == 0) {
      return 0;
    }

    c = a * b;
    require(c / a == b);
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256 c) {
    // Since Solidity automatically asserts when dividing by 0,
    // but we only need it to revert.
    require(b > 0);
    return a / b;
  }

  function mod(uint256 a, uint256 b) internal pure returns (uint256 c) {
    // Same reason as `div`.
    require(b > 0);
    return a % b;
  }

  function ceilingDiv(uint256 a, uint256 b) internal pure returns (uint256 c) {
    return add(div(a, b), mod(a, b) > 0 ? 1 : 0);
  }

  function subU64(uint64 a, uint64 b) internal pure returns (uint64 c) {
    require(b <= a);
    return a - b;
  }

  function addU8(uint8 a, uint8 b) internal pure returns (uint8 c) {
    c = a + b;
    require(c >= a);
  }
}

// File: contracts/chain/common/IValidator.sol

pragma solidity ^0.5.17;


contract IValidator {
  event ValidatorAdded(uint256 indexed _id, address indexed _validator);
  event ValidatorRemoved(uint256 indexed _id, address indexed _validator);
  event ThresholdUpdated(
    uint256 indexed _id,
    uint256 indexed _numerator,
    uint256 indexed _denominator,
    uint256 _previousNumerator,
    uint256 _previousDenominator
  );

  function isValidator(address _addr) public view returns (bool);
  function getValidators() public view returns (address[] memory _validators);

  function checkThreshold(uint256 _voteCount) public view returns (bool);
}

// File: contracts/chain/common/Validator.sol

pragma solidity ^0.5.17;




contract Validator is IValidator {
  using SafeMath for uint256;

  mapping(address => bool) validatorMap;
  address[] public validators;
  uint256 public validatorCount;

  uint256 public num;
  uint256 public denom;

  constructor(address[] memory _validators, uint256 _num, uint256 _denom)
    public
  {
    validators = _validators;
    validatorCount = _validators.length;

    for (uint256 _i = 0; _i < validatorCount; _i++) {
      address _validator = _validators[_i];
      validatorMap[_validator] = true;
    }

    num = _num;
    denom = _denom;
  }

  function isValidator(address _addr)
    public
    view
    returns (bool)
  {
    return validatorMap[_addr];
  }

  function getValidators()
    public
    view
    returns (address[] memory _validators)
  {
    _validators = validators;
  }

  function checkThreshold(uint256 _voteCount)
    public
    view
    returns (bool)
  {
    return _voteCount.mul(denom) >= num.mul(validatorCount);
  }

  function _addValidator(uint256 _id, address _validator)
    internal
  {
    require(!validatorMap[_validator]);

    validators.push(_validator);
    validatorMap[_validator] = true;
    validatorCount++;

    emit ValidatorAdded(_id, _validator);
  }

  function _removeValidator(uint256 _id, address _validator)
    internal
  {
    require(isValidator(_validator));

    uint256 _index;
    for (uint256 _i = 0; _i < validatorCount; _i++) {
      if (validators[_i] == _validator) {
        _index = _i;
        break;
      }
    }

    validatorMap[_validator] = false;
    validators[_index] = validators[validatorCount - 1];
    validators.pop();

    validatorCount--;

    emit ValidatorRemoved(_id, _validator);
  }

  function _updateQuorum(uint256 _id, uint256 _numerator, uint256 _denominator)
    internal
  {
    require(_numerator <= _denominator);
    uint256 _previousNumerator = num;
    uint256 _previousDenominator = denom;

    num = _numerator;
    denom = _denominator;

    emit ThresholdUpdated(
      _id,
      _numerator,
      _denominator,
      _previousNumerator,
      _previousDenominator
    );
  }
}

// File: contracts/chain/mainchain/MainchainValidator.sol

pragma solidity ^0.5.17;




/**
 * @title Validator
 * @dev Simple validator contract
 */
contract MainchainValidator is Validator, HasAdmin {
  uint256 nonce;

  constructor(
    address[] memory _validators,
    uint256 _num,
    uint256 _denom
  ) Validator(_validators, _num, _denom) public {
  }

  function addValidators(address[] calldata _validators) external onlyAdmin {
    for (uint256 _i; _i < _validators.length; ++_i) {
      _addValidator(nonce++, _validators[_i]);
    }
  }

  function removeValidator(address _validator) external onlyAdmin {
    _removeValidator(nonce++, _validator);
  }

  function updateQuorum(uint256 _numerator, uint256 _denominator) external onlyAdmin {
    _updateQuorum(nonce++, _numerator, _denominator);
  }
}

// File: contracts/chain/common/Registry.sol

pragma solidity ^0.5.17;



contract Registry is HasAdmin {

  event ContractAddressUpdated(
    string indexed _name,
    bytes32 indexed _code,
    address indexed _newAddress
  );

  event TokenMapped(
    address indexed _mainchainToken,
    address indexed _sidechainToken,
    uint32 _standard
  );

  string public constant GATEWAY = "GATEWAY";
  string public constant WETH_TOKEN = "WETH_TOKEN";
  string public constant VALIDATOR = "VALIDATOR";
  string public constant ACKNOWLEDGEMENT = "ACKNOWLEDGEMENT";

  struct TokenMapping {
    address mainchainToken;
    address sidechainToken;
    uint32 standard; // 20, 721 or any other standards
  }

  mapping(bytes32 => address) public contractAddresses;
  mapping(address => TokenMapping) public mainchainMap;
  mapping(address => TokenMapping) public sidechainMap;

  function getContract(string calldata _name)
    external
    view
    returns (address _address)
  {
    bytes32 _code = getCode(_name);
    _address = contractAddresses[_code];
    require(_address != address(0));
  }

  function isTokenMapped(address _token, uint32 _standard, bool _isMainchain)
    external
    view
    returns (bool)
  {
    TokenMapping memory _mapping = _getTokenMapping(_token, _isMainchain);

    return _mapping.mainchainToken != address(0) &&
      _mapping.sidechainToken != address(0) &&
      _mapping.standard == _standard;
  }

  function updateContract(string calldata _name, address _newAddress)
    external
    onlyAdmin
  {
    bytes32 _code = getCode(_name);
    contractAddresses[_code] = _newAddress;

    emit ContractAddressUpdated(_name, _code, _newAddress);
  }

  function mapToken(address _mainchainToken, address _sidechainToken, uint32 _standard)
    external
    onlyAdmin
  {
    TokenMapping memory _map = TokenMapping(
      _mainchainToken,
      _sidechainToken,
      _standard
    );

    mainchainMap[_mainchainToken] = _map;
    sidechainMap[_sidechainToken] = _map;

    emit TokenMapped(
      _mainchainToken,
      _sidechainToken,
      _standard
    );
  }

  function clearMapToken(address _mainchainToken, address _sidechainToken)
    external
    onlyAdmin
  {
    TokenMapping storage _mainchainMap = mainchainMap[_mainchainToken];
    _clearMapEntry(_mainchainMap);

    TokenMapping storage _sidechainMap = sidechainMap[_sidechainToken];
    _clearMapEntry(_sidechainMap);
  }

  function getMappedToken(
    address _token,
    bool _isMainchain
  )
    external
    view
  returns (
    address _mainchainToken,
    address _sidechainToken,
    uint32 _standard
  )
  {
    TokenMapping memory _mapping = _getTokenMapping(_token, _isMainchain);
    _mainchainToken = _mapping.mainchainToken;
    _sidechainToken = _mapping.sidechainToken;
    _standard = _mapping.standard;
  }

  function getCode(string memory _name)
    public
    pure
    returns (bytes32)
  {
    return keccak256(abi.encodePacked(_name));
  }

  function _getTokenMapping(
    address _token,
    bool isMainchain
  )
    internal
    view
    returns (TokenMapping memory _mapping)
  {
    if (isMainchain) {
      _mapping = mainchainMap[_token];
    } else {
      _mapping = sidechainMap[_token];
    }
  }

  function _clearMapEntry(TokenMapping storage _entry)
    internal
  {
    _entry.mainchainToken = address(0);
    _entry.sidechainToken = address(0);
    _entry.standard = 0;
  }
}

// File: contracts/chain/mainchain/MainchainGatewayStorage.sol

pragma solidity ^0.5.17;







/**
 * @title GatewayStorage
 * @dev Storage of deposit and withdraw information.
 */
contract MainchainGatewayStorage is ProxyStorage, Pausable {

  event TokenDeposited(
    uint256 indexed _depositId,
    address indexed _owner,
    address indexed _tokenAddress,
    address _sidechainAddress,
    uint32  _standard,
    uint256 _tokenNumber // ERC-20 amount or ERC721 tokenId
  );

  event TokenWithdrew(
    uint256 indexed _withdrawId,
    address indexed _owner,
    address indexed _tokenAddress,
    uint256 _tokenNumber
  );

  struct DepositEntry {
    address owner;
    address tokenAddress;
    address sidechainAddress;
    uint32  standard;
    uint256 tokenNumber;
  }

  struct WithdrawalEntry {
    address owner;
    address tokenAddress;
    uint256 tokenNumber;
  }

  Registry public registry;

  uint256 public depositCount;
  DepositEntry[] public deposits;
  mapping(uint256 => WithdrawalEntry) public withdrawals;

  function updateRegistry(address _registry) external onlyAdmin {
    registry = Registry(_registry);
  }
}

// File: contracts/chain/mainchain/MainchainGatewayProxy.sol

pragma solidity ^0.5.17;






contract MainchainGatewayProxy is Proxy, MainchainGatewayStorage {
  constructor(address _proxyTo, address _registry)
    public
    Proxy(_proxyTo)
  {
    registry = Registry(_registry);
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_proxyTo","type":"address"},{"internalType":"address","name":"_registry","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_oldAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"_newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_oldAdmin","type":"address"}],"name":"AdminRemoved","type":"event"},{"anonymous":false,"inputs":[],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_new","type":"address"},{"indexed":true,"internalType":"address","name":"_old","type":"address"}],"name":"ProxyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_depositId","type":"uint256"},{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_tokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_sidechainAddress","type":"address"},{"indexed":false,"internalType":"uint32","name":"_standard","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"_tokenNumber","type":"uint256"}],"name":"TokenDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_withdrawId","type":"uint256"},{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenNumber","type":"uint256"}],"name":"TokenWithdrew","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpaused","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_newAdmin","type":"address"}],"name":"changeAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"depositCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deposits","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"sidechainAddress","type":"address"},{"internalType":"uint32","name":"standard","type":"uint32"},{"internalType":"uint256","name":"tokenNumber","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"proxyType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"registry","outputs":[{"internalType":"contract Registry","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"removeAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_newProxyTo","type":"address"}],"name":"updateProxyTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"updateRegistry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdrawals","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenNumber","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506040516108283803806108288339818101604052604081101561003357600080fd5b508051602090910151600080546001600160a01b031916331780825560405184926001600160a01b039290921691907f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f908290a3610099816001600160e01b036100c016565b50600280546001600160a01b0319166001600160a01b039290921691909117905550610139565b6000546001600160a01b031633146100d757600080fd5b6001600160a01b0381166100ea57600080fd5b600180546001600160a01b0319166001600160a01b03838116918217928390556040519216917fd32d24edea94f55e932d9a008afc425a8561462d1b1f57bc6e508e9a6b9509e190600090a350565b6106e0806101486000396000f3fe6080604052600436106100dd5760003560e01c80637b1039991161007f5780639a202d47116100595780639a202d47146102b2578063b02c43d0146102c7578063f851a44014610331578063fd840de214610346576100dd565b80637b103999146102555780638456cb591461026a5780638f2839701461027f576100dd565b80634555d5c9116100bb5780634555d5c9146101925780635c60da1b146101a75780635c975abb146101d85780635cc0707614610201576100dd565b80631a5da6c8146101215780632dfdf0b5146101565780633f4ba83a1461017d575b60006100e7610379565b90506001600160a01b0381166100fc57600080fd5b60405136600082376000803683855af43d806000843e81801561011d578184f35b8184fd5b34801561012d57600080fd5b506101546004803603602081101561014457600080fd5b50356001600160a01b0316610388565b005b34801561016257600080fd5b5061016b6103c1565b60408051918252519081900360200190f35b34801561018957600080fd5b506101546103c7565b34801561019e57600080fd5b5061016b61042c565b3480156101b357600080fd5b506101bc610379565b604080516001600160a01b039092168252519081900360200190f35b3480156101e457600080fd5b506101ed610431565b604080519115158252519081900360200190f35b34801561020d57600080fd5b5061022b6004803603602081101561022457600080fd5b5035610441565b604080516001600160a01b0394851681529290931660208301528183015290519081900360600190f35b34801561026157600080fd5b506101bc61046f565b34801561027657600080fd5b5061015461047e565b34801561028b57600080fd5b50610154600480360360208110156102a257600080fd5b50356001600160a01b03166104ea565b3480156102be57600080fd5b5061015461056f565b3480156102d357600080fd5b506102f1600480360360208110156102ea57600080fd5b50356105ce565b604080516001600160a01b0396871681529486166020860152929094168383015263ffffffff166060830152608082019290925290519081900360a00190f35b34801561033d57600080fd5b506101bc610623565b34801561035257600080fd5b506101546004803603602081101561036957600080fd5b50356001600160a01b0316610632565b6001546001600160a01b031690565b6000546001600160a01b0316331461039f57600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b6000546001600160a01b031633146103de57600080fd5b600154600160a01b900460ff166103f457600080fd5b6001805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b600290565b600154600160a01b900460ff1681565b6005602052600090815260409020805460018201546002909201546001600160a01b03918216929091169083565b6002546001600160a01b031681565b6000546001600160a01b0316331461049557600080fd5b600154600160a01b900460ff16156104ac57600080fd5b6001805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6000546001600160a01b0316331461050157600080fd5b6001600160a01b03811661051457600080fd5b600080546040516001600160a01b03808516939216917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f91a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461058657600080fd5b600080546040516001600160a01b03909116917fa3b62bc36326052d97ea62d63c3d60308ed4c3ea8ac079dd8499f1e9c4f80c0f91a2600080546001600160a01b0319169055565b600481815481106105db57fe5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b0392831694509082169291821691600160a01b900463ffffffff169085565b6000546001600160a01b031681565b6000546001600160a01b0316331461064957600080fd5b6001600160a01b03811661065c57600080fd5b600180546001600160a01b0319166001600160a01b03838116918217928390556040519216917fd32d24edea94f55e932d9a008afc425a8561462d1b1f57bc6e508e9a6b9509e190600090a35056fea265627a7a723158202489cc87c94756bca4cb382b1aa499a969d11bc469ee7a3912746a14c5c7862a64736f6c634300051100320000000000000000000000008407dc57739bcda7aa53ca6f12f82f9d51c2f21e00000000000000000000000033e71e649abdc09f650ad44139674828a2075ad2

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000008407dc57739bcda7aa53ca6f12f82f9d51c2f21e00000000000000000000000033e71e649abdc09f650ad44139674828a2075ad2

-----Decoded View---------------
Arg [0] : _proxyTo (address): 0x8407dc57739bcda7aa53ca6f12f82f9d51c2f21e
Arg [1] : _registry (address): 0x33e71e649abdc09f650ad44139674828a2075ad2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008407dc57739bcda7aa53ca6f12f82f9d51c2f21e
Arg [1] : 00000000000000000000000033e71e649abdc09f650ad44139674828a2075ad2


Deployed ByteCode Sourcemap

13222:201:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2107:13;2123:16;:14;:16::i;:::-;2107:32;-1:-1:-1;;;;;;2154:19:0;;2146:28;;;;;;2218:4;2212:11;2252:12;2249:1;2244:3;2231:34;2334:1;2331;2317:12;2312:3;2305:5;2300:3;2287:49;2356:14;2401:4;2398:1;2393:3;2378:28;2423:6;2437:28;;;;2495:4;2490:3;2483:17;2437:28;2458:4;2453:3;2446:17;13008:105;;8:9:-1;5:2;;;30:1;27;20:12;5:2;13008:105:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;13008:105:0;-1:-1:-1;;;;;13008:105:0;;:::i;:::-;;12880:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;12880:27:0;;;:::i;:::-;;;;;;;;;;;;;;;;3148:96;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3148:96:0;;;:::i;1784:104::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1784:104:0;;;:::i;1572:84::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1572:84:0;;;:::i;:::-;;;;-1:-1:-1;;;;;1572:84:0;;;;;;;;;;;;;;2891:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2891:18:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;12947:54;;8:9:-1;5:2;;;30:1;27;20:12;5:2;12947:54:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;12947:54:0;;:::i;:::-;;;;-1:-1:-1;;;;;12947:54:0;;;;;;;;;;;;;;;;;;;;;;;;;;;12849:24;;8:9:-1;5:2;;;30:1;27;20:12;5:2;12849:24:0;;;:::i;3048:94::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3048:94:0;;;:::i;450:170::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;450:170:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;450:170:0;-1:-1:-1;;;;;450:170:0;;:::i;626:104::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;626:104:0;;;:::i;12912:30::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;12912:30:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;12912:30:0;;:::i;:::-;;;;-1:-1:-1;;;;;12912:30:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;246:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;246:20:0;;;:::i;2520:188::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2520:188:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2520:188:0;-1:-1:-1;;;;;2520:188:0;;:::i;1572:84::-;1642:8;;-1:-1:-1;;;;;1642:8:0;1572:84;:::o;13008:105::-;321:5;;-1:-1:-1;;;;;321:5:0;307:10;:19;299:28;;;;;;13077:8;:30;;-1:-1:-1;;;;;;13077:30:0;-1:-1:-1;;;;;13077:30:0;;;;;;;;;;13008:105::o;12880:27::-;;;;:::o;3148:96::-;321:5;;-1:-1:-1;;;;;321:5:0;307:10;:19;299:28;;;;;;3021:6;;-1:-1:-1;;;3021:6:0;;;;3013:15;;;;;;3202:6;:14;;-1:-1:-1;;;;3202:14:0;;;3228:10;;;;3211:5;;3228:10;3148:96::o;1784:104::-;1881:1;1784:104;:::o;2891:18::-;;;-1:-1:-1;;;2891:18:0;;;;;:::o;12947:54::-;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;12947:54:0;;;;;;;;;:::o;12849:24::-;;;-1:-1:-1;;;;;12849:24:0;;:::o;3048:94::-;321:5;;-1:-1:-1;;;;;321:5:0;307:10;:19;299:28;;;;;;2957:6;;-1:-1:-1;;;2957:6:0;;;;2956:7;2948:16;;;;;;3112:4;3103:13;;-1:-1:-1;;;;3103:13:0;-1:-1:-1;;;3103:13:0;;;3128:8;;;;3103:13;;3128:8;3048:94::o;450:170::-;321:5;;-1:-1:-1;;;;;321:5:0;307:10;:19;299:28;;;;;;-1:-1:-1;;;;;524:23:0;;516:32;;;;;;573:5;;;560:30;;-1:-1:-1;;;;;560:30:0;;;;573:5;;;560:30;;;597:5;:17;;-1:-1:-1;;;;;;597:17:0;-1:-1:-1;;;;;597:17:0;;;;;;;;;;450:170::o;626:104::-;321:5;;-1:-1:-1;;;;;321:5:0;307:10;:19;299:28;;;;;;693:5;;;680:19;;-1:-1:-1;;;;;693:5:0;;;;680:19;;;722:1;706:18;;-1:-1:-1;;;;;;706:18:0;;;626:104::o;12912:30::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;12912:30:0;;;;-1:-1:-1;12912:30:0;;;;;;;;-1:-1:-1;;;12912:30:0;;;;;;:::o;246:20::-;;;-1:-1:-1;;;;;246:20:0;;:::o;2520:188::-;321:5;;-1:-1:-1;;;;;321:5:0;307:10;:19;299:28;;;;;;-1:-1:-1;;;;;2596:27:0;;2588:36;;;;;;2633:8;:22;;-1:-1:-1;;;;;;2633:22:0;-1:-1:-1;;;;;2633:22:0;;;;;;;;;;2667:35;;2693:8;;;2667:35;;-1:-1:-1;;2667:35:0;2520:188;:::o

Swarm Source

bzzr://2489cc87c94756bca4cb382b1aa499a969d11bc469ee7a3912746a14c5c7862a
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.