Token
Wrapped Sonic (WSonic)
ERC-20
Overview
Max Total Supply
259.847377288437307256 WSonic
Holders
29
Market
Price
-
Onchain Market Cap
-
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
6.601075057436974258 WSonicLoading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
WSonic
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract WSonic { string public name = "Wrapped Sonic"; string public symbol = "WSonic"; uint8 public decimals = 18; event Approval(address indexed src, address indexed guy, uint256 wad); event Transfer(address indexed src, address indexed dst, uint256 wad); event Deposit(address indexed dst, uint256 wad); event Withdrawal(address indexed src, uint256 wad); mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; fallback() external { revert("Bad function to weth"); } receive() external payable { deposit(); } function deposit() public payable { balanceOf[msg.sender] += msg.value; emit Deposit(msg.sender, msg.value); } function withdraw(uint256 wad) public { require(balanceOf[msg.sender] >= wad, "Not enough balance"); balanceOf[msg.sender] -= wad; payable(msg.sender).transfer(wad); emit Withdrawal(msg.sender, wad); } function totalSupply() public view returns (uint256) { return address(this).balance; } function approve(address guy, uint256 wad) public returns (bool) { allowance[msg.sender][guy] = wad; emit Approval(msg.sender, guy, wad); return true; } function transfer(address dst, uint256 wad) public returns (bool) { return transferFrom(msg.sender, dst, wad); } function transferFrom( address src, address dst, uint256 wad ) public returns (bool) { require(balanceOf[src] >= wad, "Not enough balance"); if (src != msg.sender && allowance[src][msg.sender] != type(uint256).max) { require(allowance[src][msg.sender] >= wad, "Not enough allownace"); allowance[src][msg.sender] -= wad; } balanceOf[src] -= wad; balanceOf[dst] += wad; emit Transfer(src, dst, wad); return true; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"guy","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"dst","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"dst","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Withdrawal","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"guy","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60c0604052600d60808190526c5772617070656420536f6e696360981b60a090815261002e916000919061007c565b506040805180820190915260068082526557536f6e696360d01b602090920191825261005c9160019161007c565b506002805460ff1916601217905534801561007657600080fd5b5061014f565b82805461008890610115565b90600052602060002090601f0160209004810192826100aa57600085556100f0565b82601f106100c357805160ff19168380011785556100f0565b828001600101855582156100f0579182015b828111156100f05782518255916020019190600101906100d5565b506100fc929150610100565b5090565b5b808211156100fc5760008155600101610101565b600181811c9082168061012957607f821691505b60208210810361014957634e487b7160e01b600052602260045260246000fd5b50919050565b6108c38061015e6000396000f3fe6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce567146101b857806370a08231146101e457806395d89b4114610211578063a9059cbb14610226578063d0e30db014610246578063dd62ed3e1461024e576100af565b806306fdde0314610100578063095ea7b31461012b57806318160ddd1461015b57806323b872dd146101785780632e1a7d4d14610198576100af565b366100af576100ad610286565b005b3480156100bb57600080fd5b5060405162461bcd60e51b8152602060048201526014602482015273084c2c840cceadcc6e8d2dedc40e8de40eecae8d60631b60448201526064015b60405180910390fd5b34801561010c57600080fd5b506101156102e1565b60405161012291906106d0565b60405180910390f35b34801561013757600080fd5b5061014b610146366004610741565b61036f565b6040519015158152602001610122565b34801561016757600080fd5b50475b604051908152602001610122565b34801561018457600080fd5b5061014b61019336600461076b565b6103db565b3480156101a457600080fd5b506100ad6101b33660046107a7565b6105d1565b3480156101c457600080fd5b506002546101d29060ff1681565b60405160ff9091168152602001610122565b3480156101f057600080fd5b5061016a6101ff3660046107c0565b60036020526000908152604090205481565b34801561021d57600080fd5b506101156106af565b34801561023257600080fd5b5061014b610241366004610741565b6106bc565b6100ad610286565b34801561025a57600080fd5b5061016a6102693660046107db565b600460209081526000928352604080842090915290825290205481565b33600090815260036020526040812080543492906102a5908490610824565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b600080546102ee9061083c565b80601f016020809104026020016040519081016040528092919081815260200182805461031a9061083c565b80156103675780601f1061033c57610100808354040283529160200191610367565b820191906000526020600020905b81548152906001019060200180831161034a57829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103ca9086815260200190565b60405180910390a350600192915050565b6001600160a01b0383166000908152600360205260408120548211156104385760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b60448201526064016100f7565b6001600160a01b038416331480159061047657506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b1561051e576001600160a01b03841660009081526004602090815260408083203384529091529020548211156104e55760405162461bcd60e51b81526020600482015260146024820152734e6f7420656e6f75676820616c6c6f776e61636560601b60448201526064016100f7565b6001600160a01b038416600090815260046020908152604080832033845290915281208054849290610518908490610876565b90915550505b6001600160a01b03841660009081526003602052604081208054849290610546908490610876565b90915550506001600160a01b03831660009081526003602052604081208054849290610573908490610824565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516105bf91815260200190565b60405180910390a35060019392505050565b336000908152600360205260409020548111156106255760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b60448201526064016100f7565b3360009081526003602052604081208054839290610644908490610876565b9091555050604051339082156108fc029083906000818181858888f19350505050158015610676573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b600180546102ee9061083c565b60006106c93384846103db565b9392505050565b600060208083528351808285015260005b818110156106fd578581018301518582016040015282016106e1565b8181111561070f576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461073c57600080fd5b919050565b6000806040838503121561075457600080fd5b61075d83610725565b946020939093013593505050565b60008060006060848603121561078057600080fd5b61078984610725565b925061079760208501610725565b9150604084013590509250925092565b6000602082840312156107b957600080fd5b5035919050565b6000602082840312156107d257600080fd5b6106c982610725565b600080604083850312156107ee57600080fd5b6107f783610725565b915061080560208401610725565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b600082198211156108375761083761080e565b500190565b600181811c9082168061085057607f821691505b60208210810361087057634e487b7160e01b600052602260045260246000fd5b50919050565b6000828210156108885761088861080e565b50039056fea264697066735822122072800648b7ab88c1c014f4579d5a13ad06196abee99f8c847de24dfe875993a464736f6c634300080d0033
Deployed Bytecode
0x6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce567146101b857806370a08231146101e457806395d89b4114610211578063a9059cbb14610226578063d0e30db014610246578063dd62ed3e1461024e576100af565b806306fdde0314610100578063095ea7b31461012b57806318160ddd1461015b57806323b872dd146101785780632e1a7d4d14610198576100af565b366100af576100ad610286565b005b3480156100bb57600080fd5b5060405162461bcd60e51b8152602060048201526014602482015273084c2c840cceadcc6e8d2dedc40e8de40eecae8d60631b60448201526064015b60405180910390fd5b34801561010c57600080fd5b506101156102e1565b60405161012291906106d0565b60405180910390f35b34801561013757600080fd5b5061014b610146366004610741565b61036f565b6040519015158152602001610122565b34801561016757600080fd5b50475b604051908152602001610122565b34801561018457600080fd5b5061014b61019336600461076b565b6103db565b3480156101a457600080fd5b506100ad6101b33660046107a7565b6105d1565b3480156101c457600080fd5b506002546101d29060ff1681565b60405160ff9091168152602001610122565b3480156101f057600080fd5b5061016a6101ff3660046107c0565b60036020526000908152604090205481565b34801561021d57600080fd5b506101156106af565b34801561023257600080fd5b5061014b610241366004610741565b6106bc565b6100ad610286565b34801561025a57600080fd5b5061016a6102693660046107db565b600460209081526000928352604080842090915290825290205481565b33600090815260036020526040812080543492906102a5908490610824565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b600080546102ee9061083c565b80601f016020809104026020016040519081016040528092919081815260200182805461031a9061083c565b80156103675780601f1061033c57610100808354040283529160200191610367565b820191906000526020600020905b81548152906001019060200180831161034a57829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103ca9086815260200190565b60405180910390a350600192915050565b6001600160a01b0383166000908152600360205260408120548211156104385760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b60448201526064016100f7565b6001600160a01b038416331480159061047657506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b1561051e576001600160a01b03841660009081526004602090815260408083203384529091529020548211156104e55760405162461bcd60e51b81526020600482015260146024820152734e6f7420656e6f75676820616c6c6f776e61636560601b60448201526064016100f7565b6001600160a01b038416600090815260046020908152604080832033845290915281208054849290610518908490610876565b90915550505b6001600160a01b03841660009081526003602052604081208054849290610546908490610876565b90915550506001600160a01b03831660009081526003602052604081208054849290610573908490610824565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516105bf91815260200190565b60405180910390a35060019392505050565b336000908152600360205260409020548111156106255760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b60448201526064016100f7565b3360009081526003602052604081208054839290610644908490610876565b9091555050604051339082156108fc029083906000818181858888f19350505050158015610676573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b600180546102ee9061083c565b60006106c93384846103db565b9392505050565b600060208083528351808285015260005b818110156106fd578581018301518582016040015282016106e1565b8181111561070f576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461073c57600080fd5b919050565b6000806040838503121561075457600080fd5b61075d83610725565b946020939093013593505050565b60008060006060848603121561078057600080fd5b61078984610725565b925061079760208501610725565b9150604084013590509250925092565b6000602082840312156107b957600080fd5b5035919050565b6000602082840312156107d257600080fd5b6106c982610725565b600080604083850312156107ee57600080fd5b6107f783610725565b915061080560208401610725565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b600082198211156108375761083761080e565b500190565b600181811c9082168061085057607f821691505b60208210810361087057634e487b7160e01b600052602260045260246000fd5b50919050565b6000828210156108885761088861080e565b50039056fea264697066735822122072800648b7ab88c1c014f4579d5a13ad06196abee99f8c847de24dfe875993a464736f6c634300080d0033
[ Download: CSV Export ]
[ Download: CSV Export ]
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.