- Contract name:
- ElectroSwap
- Optimization enabled
- true
- Compiler version
- v0.8.24+commit.e11b9ed9
- Optimization runs
- 500
- Verified at
- 2024-03-10T21:18:54.513087Z
contracts/Bolt.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; /* Official token of ElectroSwap - The Electroneum Smart Chain's first DEX Website: https://electroswap.io X / Twitter: https://twitter.com/ElectroSwap_Dex Telegram: https://t.me/ElectroSwapPortal */ contract ElectroSwap { string public name = "ElectroSwap"; string public symbol = "BOLT"; uint8 public decimals = 18; uint256 public totalSupply = 100000000 * (10 ** uint256(decimals)); 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() { balances[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function balanceOf(address account) external view returns (uint256) { return balances[account]; } function transfer(address to, uint256 value) external returns (bool) { require(to != address(0), "ERC20: transfer to the zero address"); require(value <= balances[msg.sender], "ERC20: insufficient balance"); balances[msg.sender] -= value; balances[to] += value; emit Transfer(msg.sender, to, value); return true; } function approve(address spender, uint256 value) external returns (bool) { allowances[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) external returns (bool) { require(to != address(0), "ERC20: transfer to the zero address"); require(value <= balances[from], "ERC20: insufficient balance"); require(value <= allowances[from][msg.sender], "ERC20: insufficient allowance"); balances[from] -= value; balances[to] += value; allowances[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } function allowance(address owner, address spender) external view returns (uint256) { return allowances[owner][spender]; } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","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":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"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":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","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":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]}]
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461010357806370a082311461012257806395d89b411461014b578063a9059cbb14610153578063dd62ed3e1461016657600080fd5b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100d957806323b872dd146100f0575b600080fd5b6100a061019f565b6040516100ad9190610627565b60405180910390f35b6100c96100c4366004610692565b61022d565b60405190151581526020016100ad565b6100e260035481565b6040519081526020016100ad565b6100c96100fe3660046106bc565b61029a565b6002546101109060ff1681565b60405160ff90911681526020016100ad565b6100e26101303660046106f8565b6001600160a01b031660009081526004602052604090205490565b6100a06104c9565b6100c9610161366004610692565b6104d6565b6100e261017436600461071a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b600080546101ac9061074d565b80601f01602080910402602001604051908101604052809291908181526020018280546101d89061074d565b80156102255780601f106101fa57610100808354040283529160200191610225565b820191906000526020600020905b81548152906001019060200180831161020857829003601f168201915b505050505081565b3360008181526005602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906102889086815260200190565b60405180910390a35060015b92915050565b60006001600160a01b0383166103035760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084015b60405180910390fd5b6001600160a01b03841660009081526004602052604090205482111561036b5760405162461bcd60e51b815260206004820152601b60248201527f45524332303a20696e73756666696369656e742062616c616e6365000000000060448201526064016102fa565b6001600160a01b03841660009081526005602090815260408083203384529091529020548211156103de5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016102fa565b6001600160a01b0384166000908152600460205260408120805484929061040690849061079d565b90915550506001600160a01b038316600090815260046020526040812080548492906104339084906107b0565b90915550506001600160a01b03841660009081526005602090815260408083203384529091528120805484929061046b90849061079d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516104b791815260200190565b60405180910390a35060019392505050565b600180546101ac9061074d565b60006001600160a01b03831661053a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102fa565b336000908152600460205260409020548211156105995760405162461bcd60e51b815260206004820152601b60248201527f45524332303a20696e73756666696369656e742062616c616e6365000000000060448201526064016102fa565b33600090815260046020526040812080548492906105b890849061079d565b90915550506001600160a01b038316600090815260046020526040812080548492906105e59084906107b0565b90915550506040518281526001600160a01b0384169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610288565b60006020808352835180602085015260005b8181101561065557858101830151858201604001528201610639565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461068d57600080fd5b919050565b600080604083850312156106a557600080fd5b6106ae83610676565b946020939093013593505050565b6000806000606084860312156106d157600080fd5b6106da84610676565b92506106e860208501610676565b9150604084013590509250925092565b60006020828403121561070a57600080fd5b61071382610676565b9392505050565b6000806040838503121561072d57600080fd5b61073683610676565b915061074460208401610676565b90509250929050565b600181811c9082168061076157607f821691505b60208210810361078157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561029457610294610787565b808201808211156102945761029461078756fea26469706673582212202889fa80607d80ed15e00858682e848818755279bc26e36934dc2232789574a664736f6c63430008180033