ETH Price: $3,809.79 (+4.27%)

Contract

0x0EcCC7f7CDEf46d9A856F4e2cFFC049955DDeD21
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Amount:Between 1-1k
Reset Filter

Transaction Hash
Method
Block
From
To

There are no matching entries

Update your filters to view other transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenSwapBridge

Compiler Version
v0.5.0+commit.1d4f565a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license
/**
 *Submitted for verification at Etherscan.io on 2021-01-27
*/

pragma solidity ^0.5.0;
/*
 * @title: SafeMath
 * @dev: Helper contract functions to arithmatic operations safely.
 */

library SafeMath {

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        uint256 c = a - b;

        return c;
    }

}

 /*
 * @title: Token
 * @dev: Interface contract for ERC20 tokens
 */
contract Token {
    function totalSupply() public view returns (uint256 supply);

    function balanceOf(address _owner) public view returns (uint256 balance);

    function transfer(address _to, uint256 _value)
        public
        returns (bool success);

    function transferFrom(
        address _from,
        address _to,
        uint256 _value
    ) public returns (bool success);

    function approve(address _spender, uint256 _value)
        public
        returns (bool success);

    function allowance(address _owner, address _spender)
        public
        view
        returns (uint256 remaining);
    
    function burn(uint256 amount) public;

    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(
        address indexed _owner,
        address indexed _spender,
        uint256 _value
    );
}


contract TokenSwapBridge {
    using SafeMath for uint256;

    constructor() public {
        owner = msg.sender;
        paused = false;
    }
    
    event SwapKAI(address _from, address _addr, uint256 _amount);
    address constant KAI_ADDRESS = 0xD9Ec3ff1f8be459Bb9369b4E79e9Ebcf7141C093;

    address private owner;
    address[] public depositors;
    bool public paused;
    mapping (address => uint256) public amount;

    // Functions with this modifier can only be executed by the owner
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }
    
    function swapKAI(address _toAddress,  uint256 _amount) public {
        require(paused == false, "SwapToken paused");
        require(Token(KAI_ADDRESS).transferFrom(msg.sender, address(this), _amount));
        
        if (amount[_toAddress] == 0) {
            depositors.push(_toAddress);
        }
        
        amount[_toAddress] += _amount;
        
        emit SwapKAI(msg.sender, _toAddress, _amount);
    }
    
    function burnKAI() public onlyOwner {
        Token(KAI_ADDRESS).burn(getBalanceKAIContract());
    }
    
    function getBalanceKAIContract() public view returns (uint256) {
        return Token(KAI_ADDRESS).balanceOf(address(this));
    }

    function setPause() public onlyOwner {
        paused = true;
    }
    
    function setUnpause() public onlyOwner {
        paused = false;
    }
    
    function getDepositors() public view returns (address[] memory) {
        return depositors;
    }
    
    function emergencyWithdrawalKAI(uint256 _amount) public onlyOwner {
        Token(KAI_ADDRESS).transfer(msg.sender, _amount);
    }  
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[],"name":"burnKAI","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getDepositors","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"setUnpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"emergencyWithdrawalKAI","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"amount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"setPause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getBalanceKAIContract","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_toAddress","type":"address"},{"name":"_amount","type":"uint256"}],"name":"swapKAI","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"depositors","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_from","type":"address"},{"indexed":false,"name":"_addr","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"SwapKAI","type":"event"}]

608060405234801561001057600080fd5b5060008054600160a060020a031916331790556002805460ff1916905561078d8061003c6000396000f3fe6080604052600436106100a35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632e8ca99c81146100a85780635c975abb146100bf5780636c7b7f2e146100e8578063848cb5c61461014d5780638f970ea214610162578063b9f0bf661461018c578063d431b1ac146101d1578063dd173df1146101e6578063e24b0f71146101fb578063e4b2fb7914610234575b600080fd5b3480156100b457600080fd5b506100bd61027a565b005b3480156100cb57600080fd5b506100d461031f565b604080519115158252519081900360200190f35b3480156100f457600080fd5b506100fd610328565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610139578181015183820152602001610121565b505050509050019250505060405180910390f35b34801561015957600080fd5b506100bd61038a565b34801561016e57600080fd5b506100bd6004803603602081101561018557600080fd5b50356103ad565b34801561019857600080fd5b506101bf600480360360208110156101af57600080fd5b5035600160a060020a0316610466565b60408051918252519081900360200190f35b3480156101dd57600080fd5b506100bd610478565b3480156101f257600080fd5b506101bf61049e565b34801561020757600080fd5b506100bd6004803603604081101561021e57600080fd5b50600160a060020a03813516906020013561053d565b34801561024057600080fd5b5061025e6004803603602081101561025757600080fd5b5035610739565b60408051600160a060020a039092168252519081900360200190f35b600054600160a060020a0316331461029157600080fd5b73d9ec3ff1f8be459bb9369b4e79e9ebcf7141c0936342966c686102b361049e565b6040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561030557600080fd5b505af1158015610319573d6000803e3d6000fd5b50505050565b60025460ff1681565b6060600180548060200260200160405190810160405280929190818152602001828054801561038057602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610362575b5050505050905090565b600054600160a060020a031633146103a157600080fd5b6002805460ff19169055565b600054600160a060020a031633146103c457600080fd5b604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101839052905173d9ec3ff1f8be459bb9369b4e79e9ebcf7141c0939163a9059cbb9160448083019260209291908290030181600087803b15801561043757600080fd5b505af115801561044b573d6000803e3d6000fd5b505050506040513d602081101561046157600080fd5b505050565b60036020526000908152604090205481565b600054600160a060020a0316331461048f57600080fd5b6002805460ff19166001179055565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009173d9ec3ff1f8be459bb9369b4e79e9ebcf7141c093916370a0823191602480820192602092909190829003018186803b15801561050c57600080fd5b505afa158015610520573d6000803e3d6000fd5b505050506040513d602081101561053657600080fd5b5051905090565b60025460ff16156105af57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f53776170546f6b656e2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052905173d9ec3ff1f8be459bb9369b4e79e9ebcf7141c093916323b872dd9160648083019260209291908290030181600087803b15801561062857600080fd5b505af115801561063c573d6000803e3d6000fd5b505050506040513d602081101561065257600080fd5b5051151561065f57600080fd5b600160a060020a03821660009081526003602052604090205415156106d6576001805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b600160a060020a038216600081815260036020908152604091829020805485019055815133815290810192909252818101839052517f38ce90e337285ab22c1f973b9bc0c1ac0479cf0e75b794d19fa02e7662fbb8ed9181900360600190a15050565b600180548290811061074757fe5b600091825260209091200154600160a060020a031690508156fea165627a7a7230582032daa3a0b584ebbe7241b6ba25c6698bce7fa72650604cf6166d103a735ef5320029

Deployed Bytecode

0x6080604052600436106100a35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632e8ca99c81146100a85780635c975abb146100bf5780636c7b7f2e146100e8578063848cb5c61461014d5780638f970ea214610162578063b9f0bf661461018c578063d431b1ac146101d1578063dd173df1146101e6578063e24b0f71146101fb578063e4b2fb7914610234575b600080fd5b3480156100b457600080fd5b506100bd61027a565b005b3480156100cb57600080fd5b506100d461031f565b604080519115158252519081900360200190f35b3480156100f457600080fd5b506100fd610328565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610139578181015183820152602001610121565b505050509050019250505060405180910390f35b34801561015957600080fd5b506100bd61038a565b34801561016e57600080fd5b506100bd6004803603602081101561018557600080fd5b50356103ad565b34801561019857600080fd5b506101bf600480360360208110156101af57600080fd5b5035600160a060020a0316610466565b60408051918252519081900360200190f35b3480156101dd57600080fd5b506100bd610478565b3480156101f257600080fd5b506101bf61049e565b34801561020757600080fd5b506100bd6004803603604081101561021e57600080fd5b50600160a060020a03813516906020013561053d565b34801561024057600080fd5b5061025e6004803603602081101561025757600080fd5b5035610739565b60408051600160a060020a039092168252519081900360200190f35b600054600160a060020a0316331461029157600080fd5b73d9ec3ff1f8be459bb9369b4e79e9ebcf7141c0936342966c686102b361049e565b6040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561030557600080fd5b505af1158015610319573d6000803e3d6000fd5b50505050565b60025460ff1681565b6060600180548060200260200160405190810160405280929190818152602001828054801561038057602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610362575b5050505050905090565b600054600160a060020a031633146103a157600080fd5b6002805460ff19169055565b600054600160a060020a031633146103c457600080fd5b604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101839052905173d9ec3ff1f8be459bb9369b4e79e9ebcf7141c0939163a9059cbb9160448083019260209291908290030181600087803b15801561043757600080fd5b505af115801561044b573d6000803e3d6000fd5b505050506040513d602081101561046157600080fd5b505050565b60036020526000908152604090205481565b600054600160a060020a0316331461048f57600080fd5b6002805460ff19166001179055565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009173d9ec3ff1f8be459bb9369b4e79e9ebcf7141c093916370a0823191602480820192602092909190829003018186803b15801561050c57600080fd5b505afa158015610520573d6000803e3d6000fd5b505050506040513d602081101561053657600080fd5b5051905090565b60025460ff16156105af57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f53776170546f6b656e2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052905173d9ec3ff1f8be459bb9369b4e79e9ebcf7141c093916323b872dd9160648083019260209291908290030181600087803b15801561062857600080fd5b505af115801561063c573d6000803e3d6000fd5b505050506040513d602081101561065257600080fd5b5051151561065f57600080fd5b600160a060020a03821660009081526003602052604090205415156106d6576001805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b600160a060020a038216600081815260036020908152604091829020805485019055815133815290810192909252818101839052517f38ce90e337285ab22c1f973b9bc0c1ac0479cf0e75b794d19fa02e7662fbb8ed9181900360600190a15050565b600180548290811061074757fe5b600091825260209091200154600160a060020a031690508156fea165627a7a7230582032daa3a0b584ebbe7241b6ba25c6698bce7fa72650604cf6166d103a735ef5320029

Deployed Bytecode Sourcemap

1509:1725:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2564:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2564:103:0;;;;;;1882:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1882:18:0;;;;;;;;;;;;;;;;;;;;;;2984:100;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2984:100:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8::-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2984:100:0;;;;;;;;;;;;;;;;;2900:72;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2900:72:0;;;;3096:133;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3096:133:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3096:133:0;;;1907:42;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1907:42:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1907:42:0;-1:-1:-1;;;;;1907:42:0;;;;;;;;;;;;;;;;;;;2819:69;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2819:69:0;;;;2679:132;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2679:132:0;;;;2121:431;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2121:431:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;2121:431:0;;;;;;;;;1848:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1848:27:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1848:27:0;;;;;;;-1:-1:-1;;;;;1848:27:0;;;;;;;;;;;;;;2564:103;2083:5;;-1:-1:-1;;;;;2083:5:0;2069:10;:19;2061:28;;;;;;1769:42;2611:23;2635;:21;:23::i;:::-;2611:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2611:48:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2611:48:0;;;;2564:103::o;1882:18::-;;;;;;:::o;2984:100::-;3030:16;3066:10;3059:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3059:17:0;;;;;;;;;;;;;;;;;;;;;;;2984:100;:::o;2900:72::-;2083:5;;-1:-1:-1;;;;;2083:5:0;2069:10;:19;2061:28;;;;;;2950:6;:14;;-1:-1:-1;;2950:14:0;;;2900:72::o;3096:133::-;2083:5;;-1:-1:-1;;;;;2083:5:0;2069:10;:19;2061:28;;;;;;3173:48;;;;;;3201:10;3173:48;;;;;;;;;;;;1769:42;;3173:27;;:48;;;;;;;;;;;;;;-1:-1:-1;1769:42:0;3173:48;;;5:2:-1;;;;30:1;27;20:12;5:2;3173:48:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3173:48:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;3096:133:0:o;1907:42::-;;;;;;;;;;;;;:::o;2819:69::-;2083:5;;-1:-1:-1;;;;;2083:5:0;2069:10;:19;2061:28;;;;;;2867:6;:13;;-1:-1:-1;;2867:13:0;2876:4;2867:13;;;2819:69::o;2679:132::-;2760:43;;;;;;2797:4;2760:43;;;;;;2733:7;;1769:42;;2760:28;;:43;;;;;;;;;;;;;;;1769:42;2760:43;;;5:2:-1;;;;30:1;27;20:12;5:2;2760:43:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2760:43:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2760:43:0;;-1:-1:-1;2679:132:0;:::o;2121:431::-;2202:6;;;;:15;2194:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2257:67;;;;;;2289:10;2257:67;;;;2309:4;2257:67;;;;;;;;;;;;1769:42;;2257:31;;:67;;;;;;;;;;;;;;-1:-1:-1;1769:42:0;2257:67;;;5:2:-1;;;;30:1;27;20:12;5:2;2257:67:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2257:67:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2257:67:0;2249:76;;;;;;;;-1:-1:-1;;;;;2350:18:0;;;;;;:6;:18;;;;;;:23;2346:83;;;2390:10;27::-1;;23:18;;;45:23;;-1:-1;2390:27:0;;;;;;;;-1:-1:-1;;2390:27:0;-1:-1:-1;;;;;2390:27:0;;;;;2346:83;-1:-1:-1;;;;;2449:18:0;;;;;;:6;:18;;;;;;;;;:29;;;;;;2504:40;;2512:10;2504:40;;;;;;;;;;;;;;;;;;;;;;;;;2121:431;;:::o;1848:27::-;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1848:27:0;;-1:-1:-1;1848:27:0;:::o

Swarm Source

bzzr://32daa3a0b584ebbe7241b6ba25c6698bce7fa72650604cf6166d103a735ef532

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.