Contract 0x18bdc736b23ff7294bed9fa988a1443357c7b0ed

 
Txn Hash Method
Block
From
To
Value
0xa638890764dafff9fb96a0b967a3a3bd5b36745188fe4f05e064c1f14b655372Burn104145302020-07-07 20:35:19304 days 17 hrs ago0x04f264cf34440313b4a0192a352814fbe927b885 IN  0x18bdc736b23ff7294bed9fa988a1443357c7b0ed0 Ether0.00060243904923.000001907
0x913cf0ebfa62a5c74d6510cdcd9a5d3bac92fb1196fdaea071dc1dcd3a647c420x6080604089323412019-11-14 12:05:56541 days 2 hrs agoTrustlines Network: Deployer IN  Contract Creation0 Ether0.0007418793
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ForeignBridge

Compiler Version
v0.5.8+commit.23d335f2

Optimization Enabled:
Yes with 5000 runs

Other Settings:
petersburg EvmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2019-11-14
*/

pragma solidity ^0.5.8;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, "SafeMath: division by zero");
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0, "SafeMath: modulo by zero");
        return a % b;
    }
}

/*
This file incorporates code covered by the following terms:

The MIT License (MIT)

Copyright (c) 2016-2019 zOS Global Limited

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
*/

contract TrustlinesNetworkToken {
    using SafeMath for uint256;

    // We use MAX_UINT value for an approval of infinite value
    uint constant MAX_UINT = 2 ** 256 - 1;
    string private _name;
    string private _symbol;
    uint8 private _decimals;
    uint256 private _totalSupply;

    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );

    constructor(
        string memory name,
        string memory symbol,
        uint8 decimals,
        address preMintAddress,
        uint256 preMintAmount
    ) public {
        _name = name;
        _symbol = symbol;
        _decimals = decimals;

        _mint(preMintAddress, preMintAmount);
    }

    /**
    * @dev Returns the amount of tokens owned by `account`.
    */
    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }

    /**
    * @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)
        public
        view
        returns (uint256)
    {
        return _allowances[owner][spender];
    }

    function name() public view returns (string memory) {
        return _name;
    }

    function symbol() public view returns (string memory) {
        return _symbol;
    }

    function decimals() public view returns (uint8) {
        return _decimals;
    }

    /**
    * @dev Returns the amount of tokens in existence.
    */
    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

    /**
    * @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) public returns (bool) {
        _transfer(msg.sender, recipient, amount);
        return true;
    }

    /**
    * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
    *
    * Returns a boolean value indicating whether the operation succeeded.
    *
    * Approve with a value of `MAX_UINT = 2 ** 256 - 1` will symbolize
    * an approval of infinite value.
    *
    * IMPORTANT:to prevent the risk that someone may use both the old and
    * the new allowance by unfortunate transaction ordering,
    * the approval must be set to 0 before it can be changed to any
    * different desired value.
    *
    * see: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
    *
    * Emits an {Approval} event.
    */
    function approve(address spender, uint256 value) public returns (bool) {
        require(
            value == 0 || _allowances[msg.sender][spender] == 0,
            "ERC20: approve only to or from 0 value"
        );
        _approve(msg.sender, spender, value);
        return true;
    }

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

        uint _allowance = _allowances[sender][msg.sender];
        if (_allowance < MAX_UINT) {
            uint updatedAllowance = _allowance.sub(amount);
            _approve(sender, msg.sender, updatedAllowance);
        }
        return true;
    }

    function burn(uint256 amount) public {
        _burn(msg.sender, amount);
    }

    function _mint(address account, uint256 amount) internal {
        require(account != address(0), "ERC20: mint to the zero address");

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    function _transfer(address sender, address recipient, uint256 amount)
        internal
    {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _balances[sender] = _balances[sender].sub(amount);
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    function _approve(address owner, address spender, uint256 value) internal {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = value;
        emit Approval(owner, spender, value);
    }

    function _burn(address account, uint256 value) internal {
        require(account != address(0), "ERC20: burn from the zero address");

        _totalSupply = _totalSupply.sub(value);
        _balances[account] = _balances[account].sub(value);
        emit Transfer(account, address(0), value);
    }
}

/*
This file incorporates code covered by the following terms:

The MIT License (MIT)

Copyright (c) 2016-2019 zOS Global Limited

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
*/

contract ForeignBridge {
    uint public requiredBlockConfirmations = 8;
    TrustlinesNetworkToken public trustlinesNetworkToken;

    constructor(TrustlinesNetworkToken _trustlinesNetworkToken) public {
        require(
            address(_trustlinesNetworkToken) != address(0),
            "Token contract can not be on the zero address!"
        );

        trustlinesNetworkToken = _trustlinesNetworkToken;
    }

    function burn() public {
        uint256 balance = trustlinesNetworkToken.balanceOf(address(this));
        trustlinesNetworkToken.burn(balance);
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"requiredBlockConfirmations","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"trustlinesNetworkToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_trustlinesNetworkToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]

6080604052600860005534801561001557600080fd5b5060405160208061030a8339810180604052602081101561003557600080fd5b50516001600160a01b038116610096576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806102dc602e913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055610217806100c56000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80633f0a9f651461004657806344df8e7014610060578063cd1df0ed1461006a575b600080fd5b61004e61009b565b60408051918252519081900360200190f35b6100686100a1565b005b6100726101cf565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60005481565b600154604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b15801561011257600080fd5b505afa158015610126573d6000803e3d6000fd5b505050506040513d602081101561013c57600080fd5b5051600154604080517f42966c6800000000000000000000000000000000000000000000000000000000815260048101849052905192935073ffffffffffffffffffffffffffffffffffffffff909116916342966c689160248082019260009290919082900301818387803b1580156101b457600080fd5b505af11580156101c8573d6000803e3d6000fd5b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff168156fea165627a7a7230582028baa351f7ad7dbb9f17aa63b3a23cbfc19904f31e4fb2c0ad97bb4d245079460029546f6b656e20636f6e74726163742063616e206e6f74206265206f6e20746865207a65726f206164647265737321000000000000000000000000679131f591b4f369acb8cd8c51e68596806c3916

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

000000000000000000000000679131f591b4f369acb8cd8c51e68596806c3916

-----Decoded View---------------
Arg [0] : _trustlinesNetworkToken (address): 0x679131f591b4f369acb8cd8c51e68596806c3916

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000679131f591b4f369acb8cd8c51e68596806c3916


Deployed ByteCode Sourcemap

10762:594:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10762:594:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10792:42;;;:::i;:::-;;;;;;;;;;;;;;;;11199:154;;;:::i;:::-;;10841:52;;;:::i;:::-;;;;;;;;;;;;;;;;;;;10792:42;;;;:::o;11199:154::-;11251:22;;:47;;;;;;11292:4;11251:47;;;;;;11233:15;;11251:22;;;:32;;:47;;;;;;;;;;;;;;:22;:47;;;5:2:-1;;;;30:1;27;20:12;5:2;11251:47:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11251:47:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;11251:47:0;11309:22;;:36;;;;;;;;;;;;;;11251:47;;-1:-1:-1;11309:22:0;;;;;:27;;:36;;;;;:22;;:36;;;;;;;;:22;;:36;;;5:2:-1;;;;30:1;27;20:12;5:2;11309:36:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11309:36:0;;;;11199:154;:::o;10841:52::-;;;;;;:::o

Swarm Source

bzzr://28baa351f7ad7dbb9f17aa63b3a23cbfc19904f31e4fb2c0ad97bb4d24507946
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.