- We're indexing this chain right now. Some of the counts may be inaccurate.

Contract Address Details

0x826551890Dc65655a0Aceca109aB11AbDbD7a07B

Token
wCanto (WCANTO)
Creator
0x2fa8e4ā€“5ca1b1 at 0x11467dā€“8935cf
Balance
92,581,517.838864215681342732 CANTO
Tokens
Fetching tokens...
Transactions
77,136 Transactions
Transfers
0 Transfers
Gas Used
3,757,206,855
Last Balance Update
4476021
This contract has been partially verified via Sourcify. View contract in Sourcify repository
Contract name:
WETH




Optimization enabled
true
Compiler version
v0.8.11+commit.d7f03943




Optimization runs
200
EVM Version
london




Verified at
2023-02-18T14:18:10.103750Z

src/WETH.sol

pragma solidity ^0.8.10;

import "./EIP20Interface.sol";

contract WETH is EIP20Interface {
    string private _name;
    string private _symbol;
    uint8  private _decimals = 18;
    mapping (address => uint)                       public  _balanceOf;
    mapping (address => mapping (address => uint))  public  _allowance;


    constructor(string memory name_, string memory symbol_) {
	    _name = name_;
	    _symbol = symbol_;
    }

    receive() external payable {
        deposit();
    }

    function deposit() public payable {
        _balanceOf[msg.sender] += msg.value;
        emit Deposit(msg.sender, msg.value);
    }

    
    function withdraw(uint wamount) public {
        require(_balanceOf[msg.sender] >= wamount, "sender balance insufficient for withdrawal");
        _balanceOf[msg.sender] -= wamount;
        payable(msg.sender).transfer(wamount); // rentrant attack must be less than 2300 gas
        emit Withdrawal(msg.sender, wamount);
    }

    
    function name() external view returns (string memory) {
	    return _name;
    }
    function symbol() external view returns (string memory) {
	    return _symbol;
    }
    function decimals() external view returns (uint8) {
	    return _decimals;
    }
    
    function totalSupply() public view returns (uint) {
        return address(this).balance;
    }

    function balanceOf(address owner) external view returns(uint256) {
	    return _balanceOf[owner];
    }
    
    
    function approve(address spender, uint amount) public returns (bool) {
        _approve(msg.sender, spender, amount);
        emit Approval(msg.sender, spender, amount);
        return true;
    }

    function transfer(address dst, uint wad) public returns (bool) {
        return transferFrom(msg.sender, dst, wad);
    }

    function transferFrom(address src, address dst, uint wad)
        public
        returns (bool)
    {
        require(_balanceOf[src] >= wad, "WETH::transfeFrom: balance insufficient");

        if (src != msg.sender && _allowance[src][msg.sender] != type(uint).max) {
            require(_allowance[src][msg.sender] >= wad, "WETH::transferFrom:allowance insufficient");
            _allowance[src][msg.sender] -= wad;
        }

        _balanceOf[src] -= wad;
        _balanceOf[dst] += wad;

        emit Transfer(src, dst, wad);

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

        _allowance[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    function allowance(address owner, address spender) external view returns (uint256) {
	    return _allowance[owner][spender];
    }
    
    event  Deposit(address indexed dst, uint wad);
    event  Withdrawal(address indexed src, uint wad);
}

        

/src/EIP20Interface.sol

// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.10;

/**
 * @title ERC 20 Token Standard Interface
 *  https://eips.ethereum.org/EIPS/eip-20
 */
interface EIP20Interface {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);

    /**
      * @notice Get the total number of tokens in circulation
      * @return The supply of tokens
      */
    function totalSupply() external view returns (uint256);

    /**
     * @notice Gets the balance of the specified address
     * @param owner The address from which the balance will be retrieved
     * @return balance The balance
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
      * @notice Transfer `amount` tokens from `msg.sender` to `dst`
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      * @return success Whether or not the transfer succeeded
      */
    function transfer(address dst, uint256 amount) external returns (bool success);

    /**
      * @notice Transfer `amount` tokens from `src` to `dst`
      * @param src The address of the source account
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      * @return success Whether or not the transfer succeeded
      */
    function transferFrom(address src, address dst, uint256 amount) external returns (bool success);

    /**
      * @notice Approve `spender` to transfer up to `amount` from `src`
      * @dev This will overwrite the approval amount for `spender`
      *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
      * @param spender The address of the account which may transfer tokens
      * @param amount The number of tokens that are approved (-1 means infinite)
      * @return success Whether or not the approval succeeded
      */
    function approve(address spender, uint256 amount) external returns (bool success);

    /**
      * @notice Get the current allowance from `owner` for `spender`
      * @param owner The address of the account which owns the tokens to be spent
      * @param spender The address of the account which may transfer tokens
      * @return remaining The number of tokens allowed to be spent (-1 means infinite)
      */
    function allowance(address owner, address spender) external view returns (uint256 remaining);

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

Compiler Settings

{"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{"::__CACHE_BREAKER__":"0x0000000000000031363638343130343135393937"},"evmVersion":"london","compilationTarget":{"src/WETH.sol":"WETH"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"string","name":"name_","internalType":"string"},{"type":"string","name":"symbol_","internalType":"string"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"dst","internalType":"address","indexed":true},{"type":"uint256","name":"wad","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Withdrawal","inputs":[{"type":"address","name":"src","internalType":"address","indexed":true},{"type":"uint256","name":"wad","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_allowance","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_balanceOf","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"deposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"dst","internalType":"address"},{"type":"uint256","name":"wad","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"src","internalType":"address"},{"type":"address","name":"dst","internalType":"address"},{"type":"uint256","name":"wad","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"wamount","internalType":"uint256"}]},{"type":"receive","stateMutability":"payable"}]
              

Contract Creation Code

Verify & Publish
0x60806040526002805460ff191660121790553480156200001e57600080fd5b5060405162000d1c38038062000d1c8339810160408190526200004191620001e8565b81516200005690600090602085019062000075565b5080516200006c90600190602084019062000075565b5050506200028f565b828054620000839062000252565b90600052602060002090601f016020900481019282620000a75760008555620000f2565b82601f10620000c257805160ff1916838001178555620000f2565b82800160010185558215620000f2579182015b82811115620000f2578251825591602001919060010190620000d5565b506200010092915062000104565b5090565b5b8082111562000100576000815560010162000105565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200014357600080fd5b81516001600160401b03808211156200016057620001606200011b565b604051601f8301601f19908116603f011681019082821181831017156200018b576200018b6200011b565b81604052838152602092508683858801011115620001a857600080fd5b600091505b83821015620001cc5785820183015181830184015290820190620001ad565b83821115620001de5760008385830101525b9695505050505050565b60008060408385031215620001fc57600080fd5b82516001600160401b03808211156200021457600080fd5b620002228683870162000131565b935060208501519150808211156200023957600080fd5b50620002488582860162000131565b9150509250929050565b600181811c908216806200026757607f821691505b602082108114156200028957634e487b7160e01b600052602260045260246000fd5b50919050565b610a7d806200029f6000396000f3fe6080604052600436106100c65760003560e01c806370a082311161007f578063cca3e83211610059578063cca3e8321461021f578063d0e30db01461024c578063dd336c1214610254578063dd62ed3e1461028c57600080fd5b806370a08231146101b457806395d89b41146101ea578063a9059cbb146101ff57600080fd5b806306fdde03146100da578063095ea7b31461010557806318160ddd1461013557806323b872dd146101525780632e1a7d4d14610172578063313ce5671461019257600080fd5b366100d5576100d36102d2565b005b600080fd5b3480156100e657600080fd5b506100ef61032d565b6040516100fc9190610889565b60405180910390f35b34801561011157600080fd5b506101256101203660046108fa565b6103bf565b60405190151581526020016100fc565b34801561014157600080fd5b50475b6040519081526020016100fc565b34801561015e57600080fd5b5061012561016d366004610924565b610415565b34801561017e57600080fd5b506100d361018d366004610960565b610646565b34801561019e57600080fd5b5060025460405160ff90911681526020016100fc565b3480156101c057600080fd5b506101446101cf366004610979565b6001600160a01b031660009081526003602052604090205490565b3480156101f657600080fd5b506100ef610742565b34801561020b57600080fd5b5061012561021a3660046108fa565b610751565b34801561022b57600080fd5b5061014461023a366004610979565b60036020526000908152604090205481565b6100d36102d2565b34801561026057600080fd5b5061014461026f366004610994565b600460209081526000928352604080842090915290825290205481565b34801561029857600080fd5b506101446102a7366004610994565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b33600090815260036020526040812080543492906102f19084906109dd565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b60606000805461033c906109f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610368906109f5565b80156103b55780601f1061038a576101008083540402835291602001916103b5565b820191906000526020600020905b81548152906001019060200180831161039857829003601f168201915b5050505050905090565b60006103cc338484610765565b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259060200160405180910390a350600192915050565b6001600160a01b0383166000908152600360205260408120548211156104925760405162461bcd60e51b815260206004820152602760248201527f574554483a3a7472616e73666546726f6d3a2062616c616e636520696e737566604482015266199a58da595b9d60ca1b60648201526084015b60405180910390fd5b6001600160a01b03841633148015906104d057506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b15610593576001600160a01b038416600090815260046020908152604080832033845290915290205482111561055a5760405162461bcd60e51b815260206004820152602960248201527f574554483a3a7472616e7366657246726f6d3a616c6c6f77616e636520696e736044820152681d59999a58da595b9d60ba1b6064820152608401610489565b6001600160a01b03841660009081526004602090815260408083203384529091528120805484929061058d908490610a30565b90915550505b6001600160a01b038416600090815260036020526040812080548492906105bb908490610a30565b90915550506001600160a01b038316600090815260036020526040812080548492906105e89084906109dd565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161063491815260200190565b60405180910390a35060019392505050565b336000908152600360205260409020548111156106b85760405162461bcd60e51b815260206004820152602a60248201527f73656e6465722062616c616e636520696e73756666696369656e7420666f72206044820152691dda5d1a191c985dd85b60b21b6064820152608401610489565b33600090815260036020526040812080548392906106d7908490610a30565b9091555050604051339082156108fc029083906000818181858888f19350505050158015610709573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b60606001805461033c906109f5565b600061075e338484610415565b9392505050565b6001600160a01b0383166107c75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610489565b6001600160a01b0382166108285760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610489565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600060208083528351808285015260005b818110156108b65785810183015185820160400152820161089a565b818111156108c8576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108f557600080fd5b919050565b6000806040838503121561090d57600080fd5b610916836108de565b946020939093013593505050565b60008060006060848603121561093957600080fd5b610942846108de565b9250610950602085016108de565b9150604084013590509250925092565b60006020828403121561097257600080fd5b5035919050565b60006020828403121561098b57600080fd5b61075e826108de565b600080604083850312156109a757600080fd5b6109b0836108de565b91506109be602084016108de565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b600082198211156109f0576109f06109c7565b500190565b600181811c90821680610a0957607f821691505b60208210811415610a2a57634e487b7160e01b600052602260045260246000fd5b50919050565b600082821015610a4257610a426109c7565b50039056fea264697066735822122030105fcd6659bf0657b57b35fbe197458368ab0a95c133ea2fbde996a515e01164736f6c634300080b00330000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000067743616e746f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000065743414e544f0000000000000000000000000000000000000000000000000000

Deployed ByteCode

0x6080604052600436106100c65760003560e01c806370a082311161007f578063cca3e83211610059578063cca3e8321461021f578063d0e30db01461024c578063dd336c1214610254578063dd62ed3e1461028c57600080fd5b806370a08231146101b457806395d89b41146101ea578063a9059cbb146101ff57600080fd5b806306fdde03146100da578063095ea7b31461010557806318160ddd1461013557806323b872dd146101525780632e1a7d4d14610172578063313ce5671461019257600080fd5b366100d5576100d36102d2565b005b600080fd5b3480156100e657600080fd5b506100ef61032d565b6040516100fc9190610889565b60405180910390f35b34801561011157600080fd5b506101256101203660046108fa565b6103bf565b60405190151581526020016100fc565b34801561014157600080fd5b50475b6040519081526020016100fc565b34801561015e57600080fd5b5061012561016d366004610924565b610415565b34801561017e57600080fd5b506100d361018d366004610960565b610646565b34801561019e57600080fd5b5060025460405160ff90911681526020016100fc565b3480156101c057600080fd5b506101446101cf366004610979565b6001600160a01b031660009081526003602052604090205490565b3480156101f657600080fd5b506100ef610742565b34801561020b57600080fd5b5061012561021a3660046108fa565b610751565b34801561022b57600080fd5b5061014461023a366004610979565b60036020526000908152604090205481565b6100d36102d2565b34801561026057600080fd5b5061014461026f366004610994565b600460209081526000928352604080842090915290825290205481565b34801561029857600080fd5b506101446102a7366004610994565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b33600090815260036020526040812080543492906102f19084906109dd565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b60606000805461033c906109f5565b80601f0160208091040260200160405190810160405280929190818152602001828054610368906109f5565b80156103b55780601f1061038a576101008083540402835291602001916103b5565b820191906000526020600020905b81548152906001019060200180831161039857829003601f168201915b5050505050905090565b60006103cc338484610765565b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259060200160405180910390a350600192915050565b6001600160a01b0383166000908152600360205260408120548211156104925760405162461bcd60e51b815260206004820152602760248201527f574554483a3a7472616e73666546726f6d3a2062616c616e636520696e737566604482015266199a58da595b9d60ca1b60648201526084015b60405180910390fd5b6001600160a01b03841633148015906104d057506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b15610593576001600160a01b038416600090815260046020908152604080832033845290915290205482111561055a5760405162461bcd60e51b815260206004820152602960248201527f574554483a3a7472616e7366657246726f6d3a616c6c6f77616e636520696e736044820152681d59999a58da595b9d60ba1b6064820152608401610489565b6001600160a01b03841660009081526004602090815260408083203384529091528120805484929061058d908490610a30565b90915550505b6001600160a01b038416600090815260036020526040812080548492906105bb908490610a30565b90915550506001600160a01b038316600090815260036020526040812080548492906105e89084906109dd565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161063491815260200190565b60405180910390a35060019392505050565b336000908152600360205260409020548111156106b85760405162461bcd60e51b815260206004820152602a60248201527f73656e6465722062616c616e636520696e73756666696369656e7420666f72206044820152691dda5d1a191c985dd85b60b21b6064820152608401610489565b33600090815260036020526040812080548392906106d7908490610a30565b9091555050604051339082156108fc029083906000818181858888f19350505050158015610709573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b60606001805461033c906109f5565b600061075e338484610415565b9392505050565b6001600160a01b0383166107c75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610489565b6001600160a01b0382166108285760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610489565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600060208083528351808285015260005b818110156108b65785810183015185820160400152820161089a565b818111156108c8576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108f557600080fd5b919050565b6000806040838503121561090d57600080fd5b610916836108de565b946020939093013593505050565b60008060006060848603121561093957600080fd5b610942846108de565b9250610950602085016108de565b9150604084013590509250925092565b60006020828403121561097257600080fd5b5035919050565b60006020828403121561098b57600080fd5b61075e826108de565b600080604083850312156109a757600080fd5b6109b0836108de565b91506109be602084016108de565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b600082198211156109f0576109f06109c7565b500190565b600181811c90821680610a0957607f821691505b60208210811415610a2a57634e487b7160e01b600052602260045260246000fd5b50919050565b600082821015610a4257610a426109c7565b50039056fea264697066735822122030105fcd6659bf0657b57b35fbe197458368ab0a95c133ea2fbde996a515e01164736f6c634300080b0033

External libraries