Grabswap

所属分类:金融证券系统
开发工具:CSS
文件大小:939KB
下载次数:0
上传日期:2021-12-29 09:57:08
上 传 者sh-1993
说明:  Grabswap.net,技术与去中心化金融
(Grabswap.net,Technology and Decentralized Finance)

文件列表:
LICENSE (35149, 2021-12-29)
grabswap (10).js (36262, 2021-12-29)
grabswap (11).js (8222, 2021-12-29)
grabswap (12).js (9415, 2021-12-29)
grabswap (2).css (28765, 2021-12-29)
grabswap (2).js (10708, 2021-12-29)
grabswap (2).txt (614, 2021-12-29)
grabswap (2).woff (42396, 2021-12-29)
grabswap (3).css (160403, 2021-12-29)
grabswap (3).js (551, 2021-12-29)
grabswap (3).woff (34740, 2021-12-29)
grabswap (4).css (539255, 2021-12-29)
grabswap (4).js (1260026, 2021-12-29)
grabswap (4).woff (41824, 2021-12-29)
grabswap (5).css (1813, 2021-12-29)
grabswap (5).js (21009, 2021-12-29)
grabswap (6).css (13678, 2021-12-29)
grabswap (6).js (5441, 2021-12-29)
grabswap (7).js (19134, 2021-12-29)
grabswap (8).js (1068, 2021-12-29)
grabswap (9).js (23364, 2021-12-29)
grabswap.css (60720, 2021-12-29)
grabswap.ini (1303, 2021-12-29)
grabswap.js (13444, 2021-12-29)
grabswap.log (677, 2021-12-29)
grabswap.lst (8358, 2021-12-29)
grabswap.txt (15184, 2021-12-29)
grabswap.woff (42284, 2021-12-29)
grabswap.woff2 (98796, 2021-12-29)
grabswap.zip (264702, 2021-12-29)
grapswap (2).js (139570, 2021-12-29)
grapswap (3).js (107977, 2021-12-29)
grapswap (4).js (8053, 2021-12-29)
grapswap.js (6944, 2021-12-29)

# Grabswap.net Technology and Decentralized Finance /** *Submitted for verification at BscScan.com on 2020-09-02 */ // File: contracts/interface/ISystemReward.sol pragma solidity 0.***; interface ISystemReward { function claimRewards(address payable to, uint256 amount) external returns(uint256 actualAmount); } // File: contracts/interface/IRelayerHub.sol pragma solidity 0.***; interface IRelayerHub { function isRelayer(address sender) external view returns (bool); } // File: contracts/interface/ILightClient.sol pragma solidity 0.***; interface ILightClient { function isHeaderSynced(uint*** height) external view returns (bool); function getAppHash(uint*** height) external view returns (bytes32); function getSubmitter(uint*** height) external view returns (address payable); } // File: contracts/System.sol pragma solidity 0.***; contract System { bool public alreadyInit; uint32 public constant CODE_OK = 0; uint32 public constant ERROR_FAIL_DECODE = 100; uint8 constant public BIND_CHANNELID = 0x01; uint8 constant public TRANSFER_IN_CHANNELID = 0x02; uint8 constant public TRANSFER_OUT_CHANNELID = 0x03; uint8 constant public STAKING_CHANNELID = 0x08; uint8 constant public GOV_CHANNELID = 0x09; uint8 constant public SLASH_CHANNELID = 0x0b; uint16 constant public bscChainID = 0x0038; address public constant VALIDATOR_CONTRACT_ADDR = 0x0000000000000000000000000000000000001000; address public constant SLASH_CONTRACT_ADDR = 0x0000000000000000000000000000000000001001; address public constant SYSTEM_REWARD_ADDR = 0x0000000000000000000000000000000000001002; address public constant LIGHT_CLIENT_ADDR = 0x0000000000000000000000000000000000001003; address public constant TOKEN_HUB_ADDR = 0x0000000000000000000000000000000000001004; address public constant INCENTIVIZE_ADDR=0x0000000000000000000000000000000000001005; address public constant RELAYERHUB_CONTRACT_ADDR = 0x0000000000000000000000000000000000001006; address public constant GOV_HUB_ADDR = 0x0000000000000000000000000000000000001007; address public constant TOKEN_MANAGER_ADDR = 0x0000000000000000000000000000000000001008; address public constant CROSS_CHAIN_CONTRACT_ADDR = 0x0000000000000000000000000000000000002000; modifier onlyCoinbase() { require(msg.sender == block.coinbase, "the message sender must be the block producer"); _; } modifier onlyNotInit() { require(!alreadyInit, "the contract already init"); _; } modifier onlyInit() { require(alreadyInit, "the contract not init yet"); _; } modifier onlySlash() { require(msg.sender == SLASH_CONTRACT_ADDR, "the message sender must be slash contract"); _; } modifier onlyTokenHub() { require(msg.sender == TOKEN_HUB_ADDR, "the message sender must be token hub contract"); _; } modifier onlyGov() { require(msg.sender == GOV_HUB_ADDR, "the message sender must be governance contract"); _; } modifier onlyValidatorContract() { require(msg.sender == VALIDATOR_CONTRACT_ADDR, "the message sender must be validatorSet contract"); _; } modifier onlyCrossChainContract() { require(msg.sender == CROSS_CHAIN_CONTRACT_ADDR, "the message sender must be cross chain contract"); _; } modifier onlyRelayerIncentivize() { require(msg.sender == INCENTIVIZE_ADDR, "the message sender must be incentivize contract"); _; } modifier onlyRelayer() { require(IRelayerHub(RELAYERHUB_CONTRACT_ADDR).isRelayer(msg.sender), "the msg sender is not a relayer"); _; } modifier onlyTokenManager() { require(msg.sender == TOKEN_MANAGER_ADDR, "the msg sender must be tokenManager"); _; } // Not reliable, do not use when need strong verify function isContract(address addr) internal view returns (bool) { uint size; assembly { size := extcodesize(addr) } return size > 0; } } // File: contracts/lib/BytesToTypes.sol pragma solidity 0.***; /** * @title BytesToTypes * Copyright (c) 2016-2020 zpouladzade/Seriality * @dev The BytesToTypes contract converts the memory byte arrays to the standard solidity types * @author pouladzade@gmail.com */ library BytesToTypes { function bytesToAddress(uint _offst, bytes memory _input) internal pure returns (address _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToBool(uint _offst, bytes memory _input) internal pure returns (bool _output) { uint8 x; assembly { x := mload(add(_input, _offst)) } x==0 ? _output = false : _output = true; } function getStringSize(uint _offst, bytes memory _input) internal pure returns(uint size) { assembly{ size := mload(add(_input,_offst)) let chunk_count := add(div(size,32),1) // chunk_count = size/32 + 1 if gt(mod(size,32),0) {// if size%32 > 0 chunk_count := add(chunk_count,1) } size := mul(chunk_count,32)// first 32 bytes reseves for size in strings } } function bytesToString(uint _offst, bytes memory _input, bytes memory _output) internal pure { uint size = 32; assembly { let chunk_count size := mload(add(_input,_offst)) chunk_count := add(div(size,32),1) // chunk_count = size/32 + 1 if gt(mod(size,32),0) { chunk_count := add(chunk_count,1) // chunk_count++ } for { let index:= 0 } lt(index , chunk_count) { index := add(index,1) } { mstore(add(_output,mul(index,32)),mload(add(_input,_offst))) _offst := sub(_offst,32) // _offst -= 32 } } } function bytesToBytes32(uint _offst, bytes memory _input, bytes32 _output) internal pure { assembly { mstore(_output , add(_input, _offst)) mstore(add(_output,32) , add(add(_input, _offst),32)) } } function bytesToInt8(uint _offst, bytes memory _input) internal pure returns (int8 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt16(uint _offst, bytes memory _input) internal pure returns (int16 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt24(uint _offst, bytes memory _input) internal pure returns (int24 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt32(uint _offst, bytes memory _input) internal pure returns (int32 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt40(uint _offst, bytes memory _input) internal pure returns (int40 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt48(uint _offst, bytes memory _input) internal pure returns (int48 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt56(uint _offst, bytes memory _input) internal pure returns (int56 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt***(uint _offst, bytes memory _input) internal pure returns (int*** _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt72(uint _offst, bytes memory _input) internal pure returns (int72 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt80(uint _offst, bytes memory _input) internal pure returns (int80 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt88(uint _offst, bytes memory _input) internal pure returns (int88 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt96(uint _offst, bytes memory _input) internal pure returns (int96 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt104(uint _offst, bytes memory _input) internal pure returns (int104 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt112(uint _offst, bytes memory _input) internal pure returns (int112 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt120(uint _offst, bytes memory _input) internal pure returns (int120 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt128(uint _offst, bytes memory _input) internal pure returns (int128 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt136(uint _offst, bytes memory _input) internal pure returns (int136 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt144(uint _offst, bytes memory _input) internal pure returns (int144 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt152(uint _offst, bytes memory _input) internal pure returns (int152 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt160(uint _offst, bytes memory _input) internal pure returns (int160 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt168(uint _offst, bytes memory _input) internal pure returns (int168 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt176(uint _offst, bytes memory _input) internal pure returns (int176 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt184(uint _offst, bytes memory _input) internal pure returns (int184 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt192(uint _offst, bytes memory _input) internal pure returns (int192 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt200(uint _offst, bytes memory _input) internal pure returns (int200 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt208(uint _offst, bytes memory _input) internal pure returns (int208 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt216(uint _offst, bytes memory _input) internal pure returns (int216 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt224(uint _offst, bytes memory _input) internal pure returns (int224 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt232(uint _offst, bytes memory _input) internal pure returns (int232 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt240(uint _offst, bytes memory _input) internal pure returns (int240 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt248(uint _offst, bytes memory _input) internal pure returns (int248 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToInt256(uint _offst, bytes memory _input) internal pure returns (int256 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint8(uint _offst, bytes memory _input) internal pure returns (uint8 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint16(uint _offst, bytes memory _input) internal pure returns (uint16 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint24(uint _offst, bytes memory _input) internal pure returns (uint24 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint32(uint _offst, bytes memory _input) internal pure returns (uint32 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint40(uint _offst, bytes memory _input) internal pure returns (uint40 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint48(uint _offst, bytes memory _input) internal pure returns (uint48 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint56(uint _offst, bytes memory _input) internal pure returns (uint56 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint***(uint _offst, bytes memory _input) internal pure returns (uint*** _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint72(uint _offst, bytes memory _input) internal pure returns (uint72 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint80(uint _offst, bytes memory _input) internal pure returns (uint80 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint88(uint _offst, bytes memory _input) internal pure returns (uint88 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint96(uint _offst, bytes memory _input) internal pure returns (uint96 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint104(uint _offst, bytes memory _input) internal pure returns (uint104 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint112(uint _offst, bytes memory _input) internal pure returns (uint112 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint120(uint _offst, bytes memory _input) internal pure returns (uint120 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint128(uint _offst, bytes memory _input) internal pure returns (uint128 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint136(uint _offst, bytes memory _input) internal pure returns (uint136 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint144(uint _offst, bytes memory _input) internal pure returns (uint144 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint152(uint _offst, bytes memory _input) internal pure returns (uint152 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint160(uint _offst, bytes memory _input) internal pure returns (uint160 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint168(uint _offst, bytes memory _input) internal pure returns (uint168 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint176(uint _offst, bytes memory _input) internal pure returns (uint176 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint184(uint _offst, bytes memory _input) internal pure returns (uint184 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint192(uint _offst, bytes memory _input) internal pure returns (uint192 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint200(uint _offst, bytes memory _input) internal pure returns (uint200 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint208(uint _offst, bytes memory _input) internal pure returns (uint208 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint216(uint _offst, bytes memory _input) internal pure returns (uint216 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint224(uint _offst, bytes memory _input) internal pure returns (uint224 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint232(uint _offst, bytes memory _input) internal pure returns (uint232 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint240(uint _offst, bytes memory _input) internal pure returns (uint240 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint248(uint _offst, bytes memory _input) internal pure returns (uint248 _output) { assembly { _output := mload(add(_input, _offst)) } } function bytesToUint256(uint _offst, bytes memory _input) internal pure returns (uint256 _output) { assembly { _output := mload(add(_input, _offst)) } } } // File: contracts/lib/Memory.sol pragma solidity 0.***; library Memory { // Size of a word, in bytes. uint internal constant WORD_SIZE = 32; // Size of the header of a 'bytes' array. uint internal constant BYTES_HEADER_SIZE = 32; // Address of the free memory pointer. uint internal constant FREE_MEM_PTR = 0x40; // Compares the 'len' bytes starting at address 'addr' in memory with the 'len' // bytes starting at 'addr2'. // Returns 'true' if the bytes are the same, otherwise 'false'. function equals(uint addr, uint addr2, uint len) internal pure returns (bool equal) { assembly { equal := eq(keccak256(addr, len), keccak256(addr2, len)) } } // Compares the 'len' bytes starting at address 'addr' in memory with the bytes stored in // 'bts'. It is allowed to set 'len' to a lower value then 'bts.length', in which case only // the first 'len' bytes will be compared. // Requires that 'bts.length >= len' function equals(uint addr, uint len, bytes memory bts) internal pure returns (bool equal) { r ... ...

近期下载者

相关文件


收藏者