Contract 0x841ce48F9446C8E281D3F1444cB859b4A6D0738C 7

Bridge 
 
Txn Hash Method
Block
From
To
Value
0x60cdaad6d29aaeffad27f1dba62ec05b134797d8cdb5497ffc32b12c5bc7d75fTransfer Out(pending)2021-10-24 9:22:396 hrs 34 mins ago0xc5d708987dce753852bd07d7489a74978e089fcf IN Celer Network: cBridge0 Ether(Pending)(Pending)
0x7fe5f1d72786730273dceac21da964c8ddc588d267751590eef505fc377d41b1Transfer Out(pending)2021-10-24 8:25:297 hrs 31 mins ago0x60628b78653aed51ed2b126a4b415407664f0996 IN Celer Network: cBridge0 Ether(Pending)(Pending)
0x77a03c9bf9329f6ee2c1be1a0d3ac596c6660391d1507c42b61eb0f3a75a047dTransfer Out(pending)2021-10-19 3:31:305 days 12 hrs ago0x92a4b367cb74a745e385f5c7c80034338a2a0533 IN Celer Network: cBridge0 Ether(Pending)(Pending)
0x07f97dd93185dcc5a86faea0a064c4c9ff5e607aee5eaf902e03d238c64f2839Confirm134810762021-10-24 15:48:248 mins agoCeler Network: Relay Node 1 IN  Celer Network: cBridge0 Ether0.00433708140463.429878967
0xbc27d9838500a609c5e1b2ace1efb9afa4f4440a3e5ff057b24e0d30a87e6241Confirm134810652021-10-24 15:46:3110 mins agoCeler Network: Relay Node 2 IN  Celer Network: cBridge0 Ether0.00579297619981.57053423
0x7e38824af9dc87d06c7c6e2fe8c55edc539ea3e6dd0d66ce48e562f822c6ced2Transfer In134810582021-10-24 15:45:1011 mins agoCeler Network: Relay Node 1 IN  Celer Network: cBridge0 Ether0.01471646152476.720962183
0x44e25f2e6d232aa32c8a1bf6e4e954a9003142005aee0877ac7d58dc3854e7f0Transfer In134810482021-10-24 15:43:2113 mins agoCeler Network: Relay Node 2 IN  Celer Network: cBridge0 Ether0.01734485511287.41441235
0x11471871eafafb62121142da471f7916e00d1feee6a2b101bf182be936cd2198Confirm134810372021-10-24 15:41:0615 mins ago0x1feb884b806177c22073430460bee4efe2440321 IN  Celer Network: cBridge0 Ether0.00805544931594.242235428
0xfde8dfd95b9fadac3cdd04db4fc1d335f312612c52a5ade92480f3d37cb9392aTransfer In134810192021-10-24 15:37:2719 mins ago0x1feb884b806177c22073430460bee4efe2440321 IN  Celer Network: cBridge0 Ether0.01575936292282.16303412
0xead623721e9a5f6791e3ce43c78a2a46332b2e29755fb93a15b797e40248acc6Confirm134809862021-10-24 15:30:3626 mins agoCeler Network: Relay Node 2 IN  Celer Network: cBridge0 Ether0.00530790456671.667425926
0x4052c0ab6c3d3b6fe76ac241c0107ec6d3a78d06e71ef34bdfdb595e31725507Transfer In134809662021-10-24 15:26:5829 mins agoCeler Network: Relay Node 2 IN  Celer Network: cBridge0 Ether0.01515172027583.90678973
0xee759e93701c2b3df24727408cb4d1c4de8fffad0b751b6384da403485ab4ac8Confirm134809072021-10-24 15:14:2242 mins agoCeler Network: Relay Node 1 IN  Celer Network: cBridge0 Ether0.00628421885284.849639536
0xf0fc91128e3b53ce6a046f05990543ed2b98f5dfd73918460da9a0573eaff83cTransfer In134808782021-10-24 15:06:4150 mins agoCeler Network: Relay Node 1 IN  Celer Network: cBridge0 Ether0.01625416090690.011855853
0xee9eeef54b2a0ec5b8a1c73608a356106900db2b7a47604abddd4d26cb5c812bConfirm134807482021-10-24 14:35:031 hr 21 mins ago0x863e70c13417979879f39a751a4f1fd621a099a4 IN  Celer Network: cBridge0 Ether0.003858335172 67.734058472
0xd8c56ee35936436858a648aaa38e735fce364415c4f3524af05ca4d093674889Transfer Out134807292021-10-24 14:30:191 hr 26 mins ago0x863e70c13417979879f39a751a4f1fd621a099a4 IN  Celer Network: cBridge0 Ether0.010286072052 58.557712204
0xc62ebb1990c11e6e3bfa3696198e27429f98e30c117c406898a070be0990d54cConfirm134807272021-10-24 14:29:391 hr 27 mins ago0x7c40e3056a8444db649a69249885d0e1228d52bf IN  Celer Network: cBridge0 Ether0.00350909685951.338612762
0xa206465b95ce968a52a87d18eb54bc9cdfb3516ef17cc33a09892cd50671b8ccTransfer Out134806882021-10-24 14:20:441 hr 35 mins ago0x7c40e3056a8444db649a69249885d0e1228d52bf IN  Celer Network: cBridge0 Ether0.01099192431658.808962205
0x30eb05c3066599ed3a8a7ca86174f80926ee1e3006b0fad522fdd0f5618bc914Confirm134806612021-10-24 14:15:011 hr 41 mins agoCeler Network: Relay Node 2 IN  Celer Network: cBridge0 Ether0.00503965737368.045547356
0xaa7c923344225ffe9f5ad65e9fe4f5c3674505b5f4ba49b243b408cfc0c85d49Confirm134806592021-10-24 14:14:461 hr 41 mins ago0x7c40e3056a8444db649a69249885d0e1228d52bf IN  Celer Network: cBridge0 Ether0.00363829509353.210118949
0x2d93c9d5fba31ce886716f4dfda015dab6d228b5bd0dae669544068fe905e58cTransfer In134806432021-10-24 14:12:071 hr 44 mins agoCeler Network: Relay Node 2 IN  Celer Network: cBridge0 Ether0.01649567327791.34929658
0x570da7fe15392237ecc7aa3f804b51cf13155abdbb014e1fbe9a7c7d174a4ca0Confirm134806192021-10-24 14:05:021 hr 51 mins agoCeler Network: Relay Node 2 IN  Celer Network: cBridge0 Ether0.00522141392261.08631572
0x19afbe848407537ad7f915b8cdd752c77826ec9530f490f4a9601207c610dd5cTransfer In134806072021-10-24 14:03:021 hr 53 mins agoCeler Network: Relay Node 2 IN  Celer Network: cBridge0 Ether0.01669358892387.028271192
0x83f3c1c0967dfac2c6d2e8fb7e99fff0a79c338834768f7dba1069c8e90a1107Confirm134805922021-10-24 13:59:361 hr 57 mins ago0x63d417a577b50c96f4f09148d4e4d70950db0522 IN  Celer Network: cBridge0 Ether0.004624674787 65.130760608
0xdeb2b7b0b378e131fd64c13fe35e7aee3bf0355385957db34d23f31a6bdbe4e2Refund134805622021-10-24 13:51:442 hrs 4 mins ago0x33f40036f5fa59d6b3b65ef63f630cd48c8369c3 IN  Celer Network: cBridge0 Ether0.00550905071778.577246005
0xee190b55b8aa324159734ae707d6b7c09da7e2b41fac6babaf363eea29ce8314Confirm134805502021-10-24 13:48:232 hrs 8 mins agoCeler Network: Relay Node 2 IN  Celer Network: cBridge0 Ether0.00523655346670.704042052
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CBridge

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion, MIT license
File 1 of 4 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 2 of 4 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 3 of 4 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 4 of 4 : CBridge.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0 <0.9.0;
pragma abicoder v2;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract CBridge {
    using SafeERC20 for IERC20;

    enum TransferStatus {Null, Pending, Confirmed, Refunded}
    struct Transfer {
        address sender;
        address receiver;
        address token;
        uint256 amount;
        bytes32 hashlock; // hash of the preimage
        uint64 timelock; // UNIX timestamp seconds - locked UNTIL this time
        TransferStatus status;
    }

    mapping(bytes32 => Transfer) public transfers;

    event LogNewTransferOut(
        bytes32 transferId,
        address sender,
        address receiver,
        address token,
        uint256 amount,
        bytes32 hashlock, // hash of the preimage
        uint64 timelock, // UNIX timestamp seconds - locked UNTIL this time
        uint64 dstChainId,
        address dstAddress
    );
    event LogNewTransferIn(
        bytes32 transferId,
        address sender,
        address receiver,
        address token,
        uint256 amount,
        bytes32 hashlock, // hash of the preimage
        uint64 timelock, // UNIX timestamp seconds - locked UNTIL this time
        uint64 srcChainId,
        bytes32 srcTransferId // outbound transferId at src chain
    );
    event LogTransferConfirmed(bytes32 transferId, bytes32 preimage);
    event LogTransferRefunded(bytes32 transferId);

    /**
     * @dev transfer sets up a new outbound transfer with hash time lock.
     */
    function transferOut(
        address _bridge,
        address _token,
        uint256 _amount,
        bytes32 _hashlock,
        uint64 _timelock,
        uint64 _dstChainId,
        address _dstAddress
    ) external {
        bytes32 transferId = _transfer(_bridge, _token, _amount, _hashlock, _timelock);
        emit LogNewTransferOut(transferId, msg.sender, _bridge, _token, _amount, _hashlock, _timelock, _dstChainId, _dstAddress);
    }

    /**
     * @dev transfer sets up a new inbound transfer with hash time lock.
     */
    function transferIn(
        address _dstAddress,
        address _token,
        uint256 _amount,
        bytes32 _hashlock,
        uint64 _timelock,
        uint64 _srcChainId,
        bytes32 _srcTransferId
    ) external {
        bytes32 transferId = _transfer(_dstAddress, _token, _amount, _hashlock, _timelock);
        emit LogNewTransferIn(transferId, msg.sender, _dstAddress, _token, _amount, _hashlock, _timelock, _srcChainId, _srcTransferId);
    }

    /**
     * @dev confirm a transfer.
     *
     * @param _transferId Id of pending transfer.
     * @param _preimage key for the hashlock
     */
    function confirm(bytes32 _transferId, bytes32 _preimage) external {
        Transfer memory t = transfers[_transferId];

        require(t.status == TransferStatus.Pending, "not pending transfer");
        require(t.hashlock == keccak256(abi.encodePacked(_preimage)), "incorrect preimage");

        transfers[_transferId].status = TransferStatus.Confirmed;

        IERC20(t.token).safeTransfer(t.receiver, t.amount);
        emit LogTransferConfirmed(_transferId, _preimage);
    }

    /**
     * @dev refund a transfer after timeout.
     *
     * @param _transferId Id of pending transfer.
     */
    function refund(bytes32 _transferId) external {
        Transfer memory t = transfers[_transferId];

        require(t.status == TransferStatus.Pending, "not pending transfer");
        require(t.timelock <= block.timestamp, "timelock not yet passed");

        transfers[_transferId].status = TransferStatus.Refunded;

        IERC20(t.token).safeTransfer(t.sender, t.amount);
        emit LogTransferRefunded(_transferId);
    }


    /**
     * @dev transfer sets up a new transfer with hash time lock.
     */
    function _transfer(
        address _receiver,
        address _token,
        uint256 _amount,
        bytes32 _hashlock,
        uint64 _timelock
    ) private returns (bytes32 transferId) {
        require(_amount > 0, "invalid amount");
        require(_timelock > block.timestamp, "invalid timelock");

        transferId = keccak256(abi.encodePacked(msg.sender, _receiver, _hashlock, block.chainid));
        require(transfers[transferId].status == TransferStatus.Null, "transfer exists");

        IERC20(_token).safeTransferFrom(msg.sender, address(this), _amount);

        transfers[transferId] = Transfer(
            msg.sender,
            _receiver,
            _token,
            _amount,
            _hashlock,
            _timelock,
            TransferStatus.Pending
        );
        return transferId;
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"transferId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"hashlock","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"timelock","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"srcChainId","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"srcTransferId","type":"bytes32"}],"name":"LogNewTransferIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"transferId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"hashlock","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"timelock","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"dstChainId","type":"uint64"},{"indexed":false,"internalType":"address","name":"dstAddress","type":"address"}],"name":"LogNewTransferOut","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"transferId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"preimage","type":"bytes32"}],"name":"LogTransferConfirmed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"transferId","type":"bytes32"}],"name":"LogTransferRefunded","type":"event"},{"inputs":[{"internalType":"bytes32","name":"_transferId","type":"bytes32"},{"internalType":"bytes32","name":"_preimage","type":"bytes32"}],"name":"confirm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_transferId","type":"bytes32"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dstAddress","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes32","name":"_hashlock","type":"bytes32"},{"internalType":"uint64","name":"_timelock","type":"uint64"},{"internalType":"uint64","name":"_srcChainId","type":"uint64"},{"internalType":"bytes32","name":"_srcTransferId","type":"bytes32"}],"name":"transferIn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_bridge","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes32","name":"_hashlock","type":"bytes32"},{"internalType":"uint64","name":"_timelock","type":"uint64"},{"internalType":"uint64","name":"_dstChainId","type":"uint64"},{"internalType":"address","name":"_dstAddress","type":"address"}],"name":"transferOut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"transfers","outputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"hashlock","type":"bytes32"},{"internalType":"uint64","name":"timelock","type":"uint64"},{"internalType":"enum CBridge.TransferStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50610fa8806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806357f784ba1161005057806357f784ba146101045780637249fbb614610117578063f63eba251461012a57600080fd5b80633c64f04b1461006c57806346b40027146100ef575b600080fd5b6100d361007a366004610e50565b6000602081905290815260409020805460018201546002830154600384015460048501546005909501546001600160a01b03948516959385169490921692909167ffffffffffffffff811690600160401b900460ff1687565b6040516100e69796959493929190610ea5565b60405180910390f35b6101026100fd366004610d49565b61013d565b005b610102610112366004610e68565b6101de565b610102610125366004610e50565b610417565b610102610138366004610dc0565b61062d565b600061014c88888888886106bf565b604080518281523360208201526001600160a01b03808c1692820192909252818a1660608201526080810189905260a0810188905267ffffffffffffffff80881660c0830152861660e08201529084166101008201529091507f2991ed59ec037d5602bdc81fb1f3fec360f9e68fd3c1a4efb49fb3f66a88e02190610120015b60405180910390a15050505050505050565b600082815260208181526040808320815160e08101835281546001600160a01b0390811682526001830154811694820194909452600282015490931691830191909152600380820154606084015260048201546080840152600582015467ffffffffffffffff811660a085015260c0840191600160401b90910460ff169081111561027957634e487b7160e01b600052602160045260246000fd5b600381111561029857634e487b7160e01b600052602160045260246000fd5b905250905060018160c0015160038111156102c357634e487b7160e01b600052602160045260246000fd5b146103155760405162461bcd60e51b815260206004820152601460248201527f6e6f742070656e64696e67207472616e7366657200000000000000000000000060448201526064015b60405180910390fd5b604080516020810184905201604051602081830303815290604052805190602001208160800151146103895760405162461bcd60e51b815260206004820152601260248201527f696e636f727265637420707265696d6167650000000000000000000000000000604482015260640161030c565b60008381526020818152604091829020600501805468ff00000000000000001916680200000000000000001790558201516060830151918301516103d9926001600160a01b0390911691906109cc565b60408051848152602081018490527fb7ae890c7a4721f7ed769dabfeee74f0e0f5bcdaad9cab432ccea4d9fa435b50910160405180910390a1505050565b600081815260208181526040808320815160e08101835281546001600160a01b0390811682526001830154811694820194909452600282015490931691830191909152600380820154606084015260048201546080840152600582015467ffffffffffffffff811660a085015260c0840191600160401b90910460ff16908111156104b257634e487b7160e01b600052602160045260246000fd5b60038111156104d157634e487b7160e01b600052602160045260246000fd5b905250905060018160c0015160038111156104fc57634e487b7160e01b600052602160045260246000fd5b146105495760405162461bcd60e51b815260206004820152601460248201527f6e6f742070656e64696e67207472616e73666572000000000000000000000000604482015260640161030c565b428160a0015167ffffffffffffffff1611156105a75760405162461bcd60e51b815260206004820152601760248201527f74696d656c6f636b206e6f742079657420706173736564000000000000000000604482015260640161030c565b60008281526020819052604090819020600501805468ff000000000000000019166803000000000000000017905581516060830151918301516105f6926001600160a01b0390911691906109cc565b6040518281527f70a8f332cabb778f79acc5b97cbb4543970a2f1a34bd0773e4b3012931f752dc9060200160405180910390a15050565b600061063c88888888886106bf565b604080518281523360208201526001600160a01b03808c169282019290925290891660608201526080810188905260a0810187905267ffffffffffffffff80871660c0830152851660e082015261010081018490529091507f252a438c8e02dde6c26723283b3c95b1bf2550b882734770523f1d6767636f9c90610120016101cc565b60008084116107105760405162461bcd60e51b815260206004820152600e60248201527f696e76616c696420616d6f756e74000000000000000000000000000000000000604482015260640161030c565b428267ffffffffffffffff16116107695760405162461bcd60e51b815260206004820152601060248201527f696e76616c69642074696d656c6f636b00000000000000000000000000000000604482015260640161030c565b6040516bffffffffffffffffffffffff1933606090811b8216602084015288901b1660348201526048810184905246606882015260880160408051601f198184030181529190528051602090910120905060008082815260208190526040902060050154600160401b900460ff1660038111156107f657634e487b7160e01b600052602160045260246000fd5b146108435760405162461bcd60e51b815260206004820152600f60248201527f7472616e73666572206578697374730000000000000000000000000000000000604482015260640161030c565b6108586001600160a01b038616333087610a61565b6040518060e00160405280336001600160a01b03168152602001876001600160a01b03168152602001866001600160a01b031681526020018581526020018481526020018367ffffffffffffffff168152602001600160038111156108cd57634e487b7160e01b600052602160045260246000fd5b905260008281526020818152604091829020835181546001600160a01b039182167fffffffffffffffffffffffff000000000000000000000000000000000000000091821617835592850151600183018054918316918516919091179055928401516002820180549190941692169190911790915560608201516003808301919091556080830151600483015560a083015160058301805467ffffffffffffffff90921667ffffffffffffffff1983168117825560c086015193919268ffffffffffffffffff19161790600160401b9084908111156109bc57634e487b7160e01b600052602160045260246000fd5b0217905550505095945050505050565b6040516001600160a01b038316602482015260448101829052610a5c90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610a9f565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610a999085906323b872dd60e01b906084016109f8565b50505050565b6000610af4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610b849092919063ffffffff16565b805190915015610a5c5780806020019051810190610b129190610e30565b610a5c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161030c565b6060610b938484600085610b9d565b90505b9392505050565b606082471015610c155760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161030c565b843b610c635760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161030c565b600080866001600160a01b03168587604051610c7f9190610e89565b60006040518083038185875af1925050503d8060008114610cbc576040519150601f19603f3d011682016040523d82523d6000602084013e610cc1565b606091505b5091509150610cd1828286610cdc565b979650505050505050565b60608315610ceb575081610b96565b825115610cfb5782518084602001fd5b8160405162461bcd60e51b815260040161030c9190610f13565b80356001600160a01b0381168114610d2c57600080fd5b919050565b803567ffffffffffffffff81168114610d2c57600080fd5b600080600080600080600060e0888a031215610d63578283fd5b610d6c88610d15565b9650610d7a60208901610d15565b95506040880135945060608801359350610d9660808901610d31565b9250610da460a08901610d31565b9150610db260c08901610d15565b905092959891949750929550565b600080600080600080600060e0888a031215610dda578283fd5b610de388610d15565b9650610df160208901610d15565b95506040880135945060608801359350610e0d60808901610d31565b9250610e1b60a08901610d31565b915060c0880135905092959891949750929550565b600060208284031215610e41578081fd5b81518015158114610b96578182fd5b600060208284031215610e61578081fd5b5035919050565b60008060408385031215610e7a578182fd5b50508035926020909101359150565b60008251610e9b818460208701610f46565b9190910192915050565b6001600160a01b038881168252878116602083015286166040820152606081018590526080810184905267ffffffffffffffff831660a082015260e0810160048310610f0157634e487b7160e01b600052602160045260246000fd5b8260c083015298975050505050505050565b6020815260008251806020840152610f32816040850160208701610f46565b601f01601f19169190910160400192915050565b60005b83811015610f61578181015183820152602001610f49565b83811115610a99575050600091015256fea26469706673582212203f576b683b544859852e2612f7dba9316d83a2b49a4f7764b07147c61931e03a64736f6c63430008040033

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.