Token Tradepower Dex

 

Overview [ERC-20]

Max Total Supply:
20,000,000 TDEX

Holders:
69

Transfers:
-

 
Loading
[ Download CSV Export  ] 
Loading
[ Download CSV Export  ] 
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Token

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license
/**
 *Submitted for verification at Etherscan.io on 2020-08-21
*/

// Locked tokens: 2 Million (50,000 Released weekly until all 2 million is released)
pragma solidity ^0.6.0;

// ----------------------------------------------------------------------------
// 'Tradepower Dex' token contract

// Symbol      : TDEX
// Name        : Tradepower Dex
// Total supply: 20,000,000 (20 Million)
// Decimals    : 18
// ----------------------------------------------------------------------------

// "SPDX-License-Identifier: UNLICENSED "
/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 *
*/
library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }

  function ceil(uint a, uint m) internal pure returns (uint r) {
    return (a + m - 1) / m * m;
  }
}

// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
abstract contract ERC20Interface {
    function totalSupply() public virtual view returns (uint);
    function balanceOf(address tokenOwner) public virtual view returns (uint256 balance);
    function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining);
    function transfer(address to, uint256 tokens) public virtual returns (bool success);
    function approve(address spender, uint256 tokens) public virtual returns (bool success);
    function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success);

    event Transfer(address indexed from, address indexed to, uint256 tokens);
    event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
    address payable public owner;

    event OwnershipTransferred(address indexed _from, address indexed _to);

    constructor() public {
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    function transferOwnership(address payable _newOwner) public onlyOwner {
        owner = _newOwner;
        emit OwnershipTransferred(msg.sender, _newOwner);
    }
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract Token is ERC20Interface, Owned {
    using SafeMath for uint256;
    string public symbol = "TDEX";
    string public  name = "Tradepower Dex";
    uint256 public decimals = 18;
    uint256 private _totalSupply = 20e6 * 10 ** (decimals);
    uint256 private last_visit;
    uint256 private locked_tockens = 2e6 * 10 ** (decimals);
    mapping(address => uint256) balances;
    mapping(address => mapping(address => uint256)) allowed;

    // ------------------------------------------------------------------------
    // Constructor
    // ------------------------------------------------------------------------
    constructor() public {
        owner = 0x50F0fdC4E1a91C068e8c4627B7C2b418f7e6bf21;
        balances[address(owner)] = totalSupply();
        last_visit = now;
        emit Transfer(address(0),address(owner), totalSupply());
    }

    /** ERC20Interface function's implementation **/

    function totalSupply() public override view returns (uint256){
       return _totalSupply;
    }

    // ------------------------------------------------------------------------
    // Get the token balance for account `tokenOwner`
    // ------------------------------------------------------------------------
    function balanceOf(address tokenOwner) public override view returns (uint256 balance) {
        return balances[tokenOwner];
    }

    // ------------------------------------------------------------------------
    // Transfer the balance from token owner's account to `to` account
    // - Owner's account must have sufficient balance to transfer
    // - 0 value transfers are allowed
    // ------------------------------------------------------------------------
    function transfer(address to, uint256 tokens) public override returns (bool success) {
        // prevent transfer to 0x0, use burn instead
        require(address(to) != address(0));
        require(balances[msg.sender] >= tokens );
        require(balances[to] + tokens >= balances[to]);
        if (msg.sender == owner ){
            if (locked_tockens != 0){
                check_time();
            }
            require(balances[msg.sender].sub(tokens) >= locked_tockens, "Please wait for tokens to be released");
        }
        balances[msg.sender] = balances[msg.sender].sub(tokens);
        balances[to] = balances[to].add(tokens);
        emit Transfer(msg.sender, to, tokens);
        return true;
    }

    function check_time() private {
        if ((now.sub(last_visit)).div(1 weeks) >= 1){
            uint256 weeks_spanned;
            uint256 released;
            uint256 week_allowance = 50000 * 10 ** (decimals);
            weeks_spanned = (now.sub(last_visit)).div(1 weeks);
            released = weeks_spanned.mul(week_allowance);
            if (released > locked_tockens){
                released = locked_tockens;
            }
            last_visit = now;
            locked_tockens = locked_tockens.sub(released);
        }
    }

    // ------------------------------------------------------------------------
    // Token owner can approve for `spender` to transferFrom(...) `tokens`
    // from the token owner's account
    // ------------------------------------------------------------------------
    function approve(address spender, uint256 tokens) public override returns (bool success){
        allowed[msg.sender][spender] = tokens;
        emit Approval(msg.sender,spender,tokens);
        return true;
    }

    // ------------------------------------------------------------------------
    // Transfer `tokens` from the `from` account to the `to` account
    //
    // The calling account must already have sufficient tokens approve(...)-d
    // for spending from the `from` account and
    // - From account must have sufficient balance to transfer
    // - Spender must have sufficient allowance to transfer
    // - 0 value transfers are allowed
    // ------------------------------------------------------------------------
    function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){
        require(tokens <= allowed[from][msg.sender]); //check allowance
        require(balances[from] >= tokens);
        if (from == owner){
            if (locked_tockens != 0){
                check_time();
            }
            require(balances[msg.sender].sub(tokens) >= locked_tockens);
        }
        balances[from] = balances[from].sub(tokens);
        balances[to] = balances[to].add(tokens);
        allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
        emit Transfer(from,to,tokens);
        return true;
    }


    // ------------------------------------------------------------------------
    // Returns the amount of tokens approved by the owner that can be
    // transferred to the spender's account
    // ------------------------------------------------------------------------
    function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) {
        return allowed[tokenOwner][spender];
    }

}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenOwner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"tokenOwner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"remaining","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenOwner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c060405260046080819052630a8888ab60e31b60a0908152610025916001919061012c565b5060408051808201909152600e8082526d0a8e4c2c8cae0deeecae44088caf60931b602090920191825261005b9160029161012c565b5060126003556a108b2a2c280290940000006004556a01a784379d99db4200000060065534801561008b57600080fd5b50600080546001600160a01b03199081163317167350f0fdc4e1a91c068e8c4627b7c2b418f7e6bf211790556100bf610126565b600080546001600160a01b03908116825260076020526040822092909255426005558054909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610110610126565b60408051918252519081900360200190a36101bf565b60045490565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061016d57805160ff191683800117855561019a565b8280016001018555821561019a579182015b8281111561019a57825182559160200191906001019061017f565b506101a69291506101aa565b5090565b5b808211156101a657600081556001016101ab565b610907806101ce6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a08231146101c35780638da5cb5b146101e957806395d89b411461020d578063a9059cbb14610215578063dd62ed3e14610241578063f2fde38b1461026f576100a9565b806306fdde03146100ae578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610185578063313ce567146101bb575b600080fd5b6100b6610297565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b038135169060200135610322565b604080519115158252519081900360200190f35b610173610389565b60408051918252519081900360200190f35b6101576004803603606081101561019b57600080fd5b506001600160a01b0381358116916020810135909116906040013561038f565b61017361052d565b610173600480360360208110156101d957600080fd5b50356001600160a01b0316610533565b6101f161054e565b604080516001600160a01b039092168252519081900360200190f35b6100b661055d565b6101576004803603604081101561022b57600080fd5b506001600160a01b0381351690602001356105b7565b6101736004803603604081101561025757600080fd5b506001600160a01b0381358116916020013516610730565b6102956004803603602081101561028557600080fd5b50356001600160a01b031661075b565b005b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561031a5780601f106102ef5761010080835404028352916020019161031a565b820191906000526020600020905b8154815290600101906020018083116102fd57829003601f168201915b505050505081565b3360008181526008602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60045490565b6001600160a01b03831660009081526008602090815260408083203384529091528120548211156103bf57600080fd5b6001600160a01b0384166000908152600760205260409020548211156103e457600080fd5b6000546001600160a01b0385811691161415610432576006541561040a5761040a6107bd565b60065433600090815260076020526040902054610427908461084b565b101561043257600080fd5b6001600160a01b038416600090815260076020526040902054610455908361084b565b6001600160a01b038086166000908152600760205260408082209390935590851681522054610484908361085d565b6001600160a01b0380851660009081526007602090815260408083209490945591871681526008825282812033825290915220546104c2908361084b565b6001600160a01b03808616600081815260086020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60035481565b6001600160a01b031660009081526007602052604090205490565b6000546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561031a5780601f106102ef5761010080835404028352916020019161031a565b60006001600160a01b0383166105cc57600080fd5b336000908152600760205260409020548211156105e857600080fd5b6001600160a01b038316600090815260076020526040902054828101101561060f57600080fd5b6000546001600160a01b031633141561068c5760065415610632576106326107bd565b6006543360009081526007602052604090205461064f908461084b565b101561068c5760405162461bcd60e51b81526004018080602001828103825260258152602001806108ad6025913960400191505060405180910390fd5b336000908152600760205260409020546106a6908361084b565b33600090815260076020526040808220929092556001600160a01b038516815220546106d2908361085d565b6001600160a01b0384166000818152600760209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461077257600080fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b60016107e162093a806107db6005544261084b90919063ffffffff16565b90610873565b10610849576000806000600354600a0a61c35002905061081362093a806107db6005544261084b90919063ffffffff16565b925061081f8382610888565b91506006548211156108315760065491505b42600555600654610842908361084b565b6006555050505b565b60008282111561085757fe5b50900390565b60008282018381101561086c57fe5b9392505050565b60008082848161087f57fe5b04949350505050565b60008261089757506000610383565b828202828482816108a457fe5b041461086c57fefe506c65617365207761697420666f7220746f6b656e7320746f2062652072656c6561736564a264697066735822122098a31e990c61015a755551a71f321c45bcaffd2dde0df78da1e9ef804ffee12864736f6c634300060c0033

Deployed ByteCode Sourcemap

3363:5201:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3479:38;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6686:217;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;6686:217:0;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;4302:98;;;:::i;:::-;;;;;;;;;;;;;;;;7444:668;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;7444:668:0;;;;;;;;;;;;;;;;;:::i;3524:28::-;;;:::i;4625:132::-;;;;;;;;;;;;;;;;-1:-1:-1;4625:132:0;-1:-1:-1;;;;;4625:132:0;;:::i;2665:28::-;;;:::i;:::-;;;;-1:-1:-1;;;;;2665:28:0;;;;;;;;;;;;;;3443:29;;;:::i;5106:733::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;5106:733:0;;;;;;;;:::i;8400:159::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;8400:159:0;;;;;;;;;;:::i;2933:166::-;;;;;;;;;;;;;;;;-1:-1:-1;2933:166:0;-1:-1:-1;;;;;2933:166:0;;:::i;:::-;;3479:38;;;;;;;;;;;;;;-1:-1:-1;;3479:38:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;6686:217::-;6793:10;6761:12;6785:19;;;:7;:19;;;;;;;;-1:-1:-1;;;;;6785:28:0;;;;;;;;;;;:37;;;6838:35;;;;;;;6761:12;;6785:28;;6793:10;;6838:35;;;;;;;;-1:-1:-1;6891:4:0;6686:217;;;;;:::o;4302:98::-;4380:12;;4302:98;:::o;7444:668::-;-1:-1:-1;;;;;7575:13:0;;7533:12;7575:13;;;:7;:13;;;;;;;;7589:10;7575:25;;;;;;;;7565:35;;;7557:44;;;;;;-1:-1:-1;;;;;7638:14:0;;;;;;:8;:14;;;;;;:24;-1:-1:-1;7638:24:0;7630:33;;;;;;7686:5;;-1:-1:-1;;;;;7678:13:0;;;7686:5;;7678:13;7674:189;;;7711:14;;:19;7707:71;;7750:12;:10;:12::i;:::-;7836:14;;7809:10;7800:20;;;;:8;:20;;;;;;:32;;7825:6;7800:24;:32::i;:::-;:50;;7792:59;;;;;;-1:-1:-1;;;;;7890:14:0;;;;;;:8;:14;;;;;;:26;;7909:6;7890:18;:26::i;:::-;-1:-1:-1;;;;;7873:14:0;;;;;;;:8;:14;;;;;;:43;;;;7942:12;;;;;;;:24;;7959:6;7942:16;:24::i;:::-;-1:-1:-1;;;;;7927:12:0;;;;;;;:8;:12;;;;;;;;:39;;;;8005:13;;;;;:7;:13;;;;;8019:10;8005:25;;;;;;;:37;;8035:6;8005:29;:37::i;:::-;-1:-1:-1;;;;;7977:13:0;;;;;;;:7;:13;;;;;;;;7991:10;7977:25;;;;;;;;:65;;;;8058:24;;;;;;;;;;;7977:13;;8058:24;;;;;;;;;;;-1:-1:-1;8100:4:0;7444:668;;;;;:::o;3524:28::-;;;;:::o;4625:132::-;-1:-1:-1;;;;;4729:20:0;4694:15;4729:20;;;:8;:20;;;;;;;4625:132::o;2665:28::-;;;-1:-1:-1;;;;;2665:28:0;;:::o;3443:29::-;;;;;;;;;;;;;;;-1:-1:-1;;3443:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5106:733;5177:12;-1:-1:-1;;;;;5264:25:0;;5256:34;;;;;;5318:10;5309:20;;;;:8;:20;;;;;;:30;-1:-1:-1;5309:30:0;5301:40;;;;;;-1:-1:-1;;;;;5385:12:0;;;;;;:8;:12;;;;;;5360:21;;;:37;;5352:46;;;;;;5427:5;;-1:-1:-1;;;;;5427:5:0;5413:10;:19;5409:237;;;5453:14;;:19;5449:71;;5492:12;:10;:12::i;:::-;5578:14;;5551:10;5542:20;;;;:8;:20;;;;;;:32;;5567:6;5542:24;:32::i;:::-;:50;;5534:100;;;;-1:-1:-1;;;5534:100:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5688:10;5679:20;;;;:8;:20;;;;;;:32;;5704:6;5679:24;:32::i;:::-;5665:10;5656:20;;;;:8;:20;;;;;;:55;;;;-1:-1:-1;;;;;5737:12:0;;;;;;:24;;5754:6;5737:16;:24::i;:::-;-1:-1:-1;;;;;5722:12:0;;;;;;:8;:12;;;;;;;;;:39;;;;5777:32;;;;;;;5722:12;;5786:10;;5777:32;;;;;;;;;;-1:-1:-1;5827:4:0;5106:733;;;;:::o;8400:159::-;-1:-1:-1;;;;;8523:19:0;;;8486:17;8523:19;;;:7;:19;;;;;;;;:28;;;;;;;;;;;;;8400:159::o;2933:166::-;2899:5;;-1:-1:-1;;;;;2899:5:0;2885:10;:19;2877:28;;;;;;3015:5:::1;:17:::0;;-1:-1:-1;;;;;;3015:17:0::1;-1:-1:-1::0;;;;;3015:17:0;::::1;::::0;;::::1;::::0;;3048:43:::1;::::0;3015:17;;3069:10:::1;::::0;3048:43:::1;::::0;3015:5;3048:43:::1;2933:166:::0;:::o;5847:554::-;5930:1;5892:34;5918:7;5893:19;5901:10;;5893:3;:7;;:19;;;;:::i;:::-;5892:25;;:34::i;:::-;:39;5888:506;;5947:21;5983:16;6014:22;6054:8;;6047:2;:16;6039:5;:24;6014:49;;6094:34;6120:7;6095:19;6103:10;;6095:3;:7;;:19;;;;:::i;6094:34::-;6078:50;-1:-1:-1;6154:33:0;6078:50;6172:14;6154:17;:33::i;:::-;6143:44;;6217:14;;6206:8;:25;6202:90;;;6262:14;;6251:25;;6202:90;6319:3;6306:10;:16;6354:14;;:28;;6373:8;6354:18;:28::i;:::-;6337:14;:45;-1:-1:-1;;;5888:506:0;5847:554::o;1054:113::-;1112:7;1140:1;1135;:6;;1128:14;;;;-1:-1:-1;1156:5:0;;;1054:113::o;1171:133::-;1229:7;1257:5;;;1276:6;;;;1269:14;;;;1297:1;1171:133;-1:-1:-1;;;1171:133:0:o;780:270::-;838:7;929:9;945:1;941;:5;;;;;;;780:270;-1:-1:-1;;;;780:270:0:o;596:180::-;654:7;674:6;670:37;;-1:-1:-1;698:1:0;691:8;;670:37;725:5;;;729:1;725;:5;:1;744:5;;;;;:10;737:18;;

Swarm Source

ipfs://98a31e990c61015a755551a71f321c45bcaffd2dde0df78da1e9ef804ffee128

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.