Token
SwapX (SWPx)
ERC-20
Overview
Max Total Supply
111,161,742.310858762378514116 SWPx
Holders
22
Market
Price
-
Onchain Market Cap
-
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
0.000000000001205177 SWPxLoading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
SWPx
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: GPL-3.0-or-later pragma solidity 0.8.13; import {ISWPx} from "./interfaces/ISWPx.sol"; contract SWPx is ISWPx { string public constant name = "SwapX"; string public constant symbol = "SWPx"; uint8 public constant decimals = 18; uint public totalSupply = 0; mapping(address => uint) public balanceOf; mapping(address => mapping(address => uint)) public allowance; bool public initialMinted; address public minter; event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); constructor() { minter = msg.sender; _mint(msg.sender, 0); } // No checks as its meant to be once off to set minting rights to BaseV1 Minter function setMinter(address _minter) external { require(msg.sender == minter); minter = _minter; } // Initial mint: total 42M function initialMint(address _recipient) external { require(msg.sender == minter && !initialMinted); initialMinted = true; _mint(_recipient, 42 * 1e6 * 1e18); } function approve(address _spender, uint _value) external returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function _mint(address _to, uint _amount) internal returns (bool) { totalSupply += _amount; unchecked { balanceOf[_to] += _amount; } emit Transfer(address(0x0), _to, _amount); return true; } function _burn(address account, uint256 amount) internal { uint256 accountBalance = balanceOf[account]; require(accountBalance >= amount && amount > 0, "burn amount exceeds balance or zero"); unchecked { balanceOf[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. totalSupply -= amount; } emit Transfer(account, address(0), amount); } function _transfer(address _from, address _to, uint _value) internal returns (bool) { balanceOf[_from] -= _value; unchecked { balanceOf[_to] += _value; } emit Transfer(_from, _to, _value); return true; } function transfer(address _to, uint _value) external returns (bool) { return _transfer(msg.sender, _to, _value); } function transferFrom(address _from, address _to, uint _value) external returns (bool) { uint allowed_from = allowance[_from][msg.sender]; if (allowed_from != type(uint).max) { allowance[_from][msg.sender] -= _value; } return _transfer(_from, _to, _value); } function mint(address account, uint amount) external returns (bool) { require(msg.sender == minter, 'not allowed'); _mint(account, amount); return true; } function burn(uint amount) external { _burn(msg.sender, amount); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface ISWPx { function initialMint(address _recipient) external; function totalSupply() external view returns (uint); function balanceOf(address) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address, uint) external returns (bool); function transferFrom(address,address,uint) external returns (bool); function mint(address, uint) external returns (bool); function minter() external returns (address); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","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"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"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":"_spender","type":"address"},{"internalType":"uint256","name":"_value","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":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"initialMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","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":"_value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526000805534801561001457600080fd5b5060038054610100600160a81b0319163361010081029190911790915561003c906000610042565b506100d9565b60008160008082825461005591906100b3565b90915550506001600160a01b0383166000818152600160209081526040808320805487019055518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350600192915050565b600082198211156100d457634e487b7160e01b600052601160045260246000fd5b500190565b610840806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806342966c6811610097578063c268f9ba11610066578063c268f9ba14610249578063ca1c4de91461025c578063dd62ed3e14610269578063fca3b5aa1461029457600080fd5b806342966c68146101de57806370a08231146101f357806395d89b4114610213578063a9059cbb1461023657600080fd5b806318160ddd116100d357806318160ddd1461018757806323b872dd1461019e578063313ce567146101b157806340c10f19146101cb57600080fd5b806306fdde03146100fa5780630754617214610134578063095ea7b314610164575b600080fd5b61011e604051806040016040528060058152602001640a6eec2e0b60db1b81525081565b60405161012b9190610687565b60405180910390f35b60035461014c9061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161012b565b6101776101723660046106f8565b6102a7565b604051901515815260200161012b565b61019060005481565b60405190815260200161012b565b6101776101ac366004610722565b610313565b6101b9601281565b60405160ff909116815260200161012b565b6101776101d93660046106f8565b61038d565b6101f16101ec36600461075e565b6103f6565b005b610190610201366004610777565b60016020526000908152604090205481565b61011e604051806040016040528060048152602001630a6aea0f60e31b81525081565b6101776102443660046106f8565b610403565b6101f1610257366004610777565b610417565b6003546101779060ff1681565b610190610277366004610792565b600260209081526000928352604080842090915290825290205481565b6101f16102a2366004610777565b610468565b3360008181526002602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103029086815260200190565b60405180910390a350600192915050565b6001600160a01b03831660009081526002602090815260408083203384529091528120546000198114610379576001600160a01b0385166000908152600260209081526040808320338452909152812080548592906103739084906107db565b90915550505b6103848585856104ac565b95945050505050565b60035460009061010090046001600160a01b031633146103e25760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b60448201526064015b60405180910390fd5b6103ec8383610543565b5060019392505050565b61040033826105a8565b50565b60006104103384846104ac565b9392505050565b60035461010090046001600160a01b031633148015610439575060035460ff16155b61044257600080fd5b6003805460ff19166001179055610464816a22bdd88fed9efc6a000000610543565b5050565b60035461010090046001600160a01b0316331461048457600080fd5b600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b0383166000908152600160205260408120805483919083906104d69084906107db565b90915550506001600160a01b03808416600081815260016020526040908190208054860190555190918616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906105319086815260200190565b60405180910390a35060019392505050565b60008160008082825461055691906107f2565b90915550506001600160a01b0383166000818152600160209081526040808320805487019055518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610302565b6001600160a01b0382166000908152600160205260409020548181108015906105d15750600082115b6106295760405162461bcd60e51b815260206004820152602360248201527f6275726e20616d6f756e7420657863656564732062616c616e6365206f72207a60448201526265726f60e81b60648201526084016103d9565b6001600160a01b0383166000818152600160209081526040808320868603905582548690038355518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600060208083528351808285015260005b818110156106b457858101830151858201604001528201610698565b818111156106c6576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146106f357600080fd5b919050565b6000806040838503121561070b57600080fd5b610714836106dc565b946020939093013593505050565b60008060006060848603121561073757600080fd5b610740846106dc565b925061074e602085016106dc565b9150604084013590509250925092565b60006020828403121561077057600080fd5b5035919050565b60006020828403121561078957600080fd5b610410826106dc565b600080604083850312156107a557600080fd5b6107ae836106dc565b91506107bc602084016106dc565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b6000828210156107ed576107ed6107c5565b500390565b60008219821115610805576108056107c5565b50019056fea2646970667358221220228b224ed10dbf74dc2c80a15a045827b9e2e5859ea3248a30c37068d580ad3c64736f6c634300080d0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806342966c6811610097578063c268f9ba11610066578063c268f9ba14610249578063ca1c4de91461025c578063dd62ed3e14610269578063fca3b5aa1461029457600080fd5b806342966c68146101de57806370a08231146101f357806395d89b4114610213578063a9059cbb1461023657600080fd5b806318160ddd116100d357806318160ddd1461018757806323b872dd1461019e578063313ce567146101b157806340c10f19146101cb57600080fd5b806306fdde03146100fa5780630754617214610134578063095ea7b314610164575b600080fd5b61011e604051806040016040528060058152602001640a6eec2e0b60db1b81525081565b60405161012b9190610687565b60405180910390f35b60035461014c9061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161012b565b6101776101723660046106f8565b6102a7565b604051901515815260200161012b565b61019060005481565b60405190815260200161012b565b6101776101ac366004610722565b610313565b6101b9601281565b60405160ff909116815260200161012b565b6101776101d93660046106f8565b61038d565b6101f16101ec36600461075e565b6103f6565b005b610190610201366004610777565b60016020526000908152604090205481565b61011e604051806040016040528060048152602001630a6aea0f60e31b81525081565b6101776102443660046106f8565b610403565b6101f1610257366004610777565b610417565b6003546101779060ff1681565b610190610277366004610792565b600260209081526000928352604080842090915290825290205481565b6101f16102a2366004610777565b610468565b3360008181526002602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103029086815260200190565b60405180910390a350600192915050565b6001600160a01b03831660009081526002602090815260408083203384529091528120546000198114610379576001600160a01b0385166000908152600260209081526040808320338452909152812080548592906103739084906107db565b90915550505b6103848585856104ac565b95945050505050565b60035460009061010090046001600160a01b031633146103e25760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b60448201526064015b60405180910390fd5b6103ec8383610543565b5060019392505050565b61040033826105a8565b50565b60006104103384846104ac565b9392505050565b60035461010090046001600160a01b031633148015610439575060035460ff16155b61044257600080fd5b6003805460ff19166001179055610464816a22bdd88fed9efc6a000000610543565b5050565b60035461010090046001600160a01b0316331461048457600080fd5b600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b0383166000908152600160205260408120805483919083906104d69084906107db565b90915550506001600160a01b03808416600081815260016020526040908190208054860190555190918616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906105319086815260200190565b60405180910390a35060019392505050565b60008160008082825461055691906107f2565b90915550506001600160a01b0383166000818152600160209081526040808320805487019055518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610302565b6001600160a01b0382166000908152600160205260409020548181108015906105d15750600082115b6106295760405162461bcd60e51b815260206004820152602360248201527f6275726e20616d6f756e7420657863656564732062616c616e6365206f72207a60448201526265726f60e81b60648201526084016103d9565b6001600160a01b0383166000818152600160209081526040808320868603905582548690038355518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600060208083528351808285015260005b818110156106b457858101830151858201604001528201610698565b818111156106c6576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146106f357600080fd5b919050565b6000806040838503121561070b57600080fd5b610714836106dc565b946020939093013593505050565b60008060006060848603121561073757600080fd5b610740846106dc565b925061074e602085016106dc565b9150604084013590509250925092565b60006020828403121561077057600080fd5b5035919050565b60006020828403121561078957600080fd5b610410826106dc565b600080604083850312156107a557600080fd5b6107ae836106dc565b91506107bc602084016106dc565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b6000828210156107ed576107ed6107c5565b500390565b60008219821115610805576108056107c5565b50019056fea2646970667358221220228b224ed10dbf74dc2c80a15a045827b9e2e5859ea3248a30c37068d580ad3c64736f6c634300080d0033
[ 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.