Address Contract Verified
Address
0xDdADA03731dA4A9B69eE88A7eB81F51Fcb5728c5
Balance
0 ETH
Nonce
1
Code Size
8815 bytes
Creator
0x52c0Ee6b...2242 at tx 0xe8595a11...a70925
Indexed Transactions
0
Contract Bytecode
8815 bytes
0x608060405234801561000f575f80fd5b50600436106100fe575f3560e01c80638da5cb5b11610095578063bd3a13f611610064578063bd3a13f6146102c2578063c45a0155146102de578063dd62ed3e146102fc578063f2fde38b1461032c576100fe565b80638da5cb5b1461022657806395d89b4114610244578063a457c2d714610262578063a9059cbb14610292576100fe565b8063313ce567116100d1578063313ce5671461019e57806339509351146101bc57806370a08231146101ec578063715018a61461021c576100fe565b806306fdde0314610102578063095ea7b31461012057806318160ddd1461015057806323b872dd1461016e575b5f80fd5b61010a610348565b60405161011791906114cb565b60405180910390f35b61013a60048036038101906101359190611589565b6103d4565b60405161014791906115e1565b60405180910390f35b61015861059d565b6040516101659190611609565b60405180910390f35b61018860048036038101906101839190611622565b6105a6565b60405161019591906115e1565b60405180910390f35b6101a6610962565b6040516101b3919061168d565b60405180910390f35b6101d660048036038101906101d19190611589565b610974565b6040516101e391906115e1565b60405180910390f35b610206600480360381019061020191906116a6565b610a0d565b6040516102139190611609565b60405180910390f35b610224610a53565b005b61022e610a66565b60405161023b91906116e0565b60405180910390f35b61024c610a8d565b60405161025991906114cb565b60405180910390f35b61027c60048036038101906102779190611589565b610b19565b60405161028991906115e1565b60405180910390f35b6102ac60048036038101906102a79190611589565b610bfa565b6040516102b991906115e1565b60405180910390f35b6102dc60048036038101906102d79190611825565b610e6c565b005b6102e6611004565b6040516102f391906116e0565b60405180910390f35b610316600480360381019061031191906118c1565b611029565b6040516103239190611609565b60405180910390f35b610346600480360381019061034191906116a6565b6110ab565b005b600180546103559061192c565b80601f01602080910402602001604051908101604052809291908181526020018280546103819061192c565b80156103cc5780601f106103a3576101008083540402835291602001916103cc565b820191905f5260205f20905b8154815290600101906020018083116103af57829003601f168201915b505050505081565b5f8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603610443576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161043a906119cc565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a890611a5a565b60405180910390fd5b8160065f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161058b9190611609565b60405180910390a36001905092915050565b5f600454905090565b5f8073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603610615576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060c90611ae8565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a90611b76565b60405180910390fd5b8160055f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20541015610703576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106fa90611bde565b60405180910390fd5b8160065f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205410156107be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b590611c6c565b60405180910390fd5b8160055f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461080a9190611cb7565b925050819055508160055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461085d9190611cea565b925050819055508160065f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282546108eb9190611cb7565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161094f9190611609565b60405180910390a3600190509392505050565b60035f9054906101000a900460ff1681565b5f610a0333848460065f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546109fe9190611cea565b61112f565b6001905092915050565b5f60055f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b610a5b6112f2565b610a645f611379565b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60028054610a9a9061192c565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac69061192c565b8015610b115780601f10610ae857610100808354040283529160200191610b11565b820191905f5260205f20905b815481529060010190602001808311610af457829003601f168201915b505050505081565b5f8060065f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905082811015610bd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd090611d8d565b60405180910390fd5b610bef33858584610bea9190611cb7565b61112f565b600191505092915050565b5f8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603610c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6090611ae8565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cce90611b76565b60405180910390fd5b8160055f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20541015610d57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4e90611bde565b60405180910390fd5b8160055f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254610da39190611cb7565b925050819055508160055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254610df69190611cea565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e5a9190611609565b60405180910390a36001905092915050565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610efb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef290611df5565b60405180910390fd5b610f04816110ab565b8360019081610f139190611fb0565b508260029081610f239190611fb0565b5060035f9054906101000a900460ff1660ff16600a610f4291906121ae565b82610f4d91906121f8565b60048190555060045460055f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508073ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600454604051610ff69190611609565b60405180910390a350505050565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60065f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b6110b36112f2565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611123575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161111a91906116e0565b60405180910390fd5b61112c81611379565b50565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361119d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611194906119cc565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361120b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120290611a5a565b60405180910390fd5b8060065f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112e59190611609565b60405180910390a3505050565b6112fa61143a565b73ffffffffffffffffffffffffffffffffffffffff16611318610a66565b73ffffffffffffffffffffffffffffffffffffffff16146113775761133b61143a565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161136e91906116e0565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561147857808201518184015260208101905061145d565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61149d82611441565b6114a7818561144b565b93506114b781856020860161145b565b6114c081611483565b840191505092915050565b5f6020820190508181035f8301526114e38184611493565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611525826114fc565b9050919050565b6115358161151b565b811461153f575f80fd5b50565b5f813590506115508161152c565b92915050565b5f819050919050565b61156881611556565b8114611572575f80fd5b50565b5f813590506115838161155f565b92915050565b5f806040838503121561159f5761159e6114f4565b5b5f6115ac85828601611542565b92505060206115bd85828601611575565b9150509250929050565b5f8115159050919050565b6115db816115c7565b82525050565b5f6020820190506115f45f8301846115d2565b92915050565b61160381611556565b82525050565b5f60208201905061161c5f8301846115fa565b92915050565b5f805f60608486031215611639576116386114f4565b5b5f61164686828701611542565b935050602061165786828701611542565b925050604061166886828701611575565b9150509250925092565b5f60ff82169050919050565b61168781611672565b82525050565b5f6020820190506116a05f83018461167e565b92915050565b5f602082840312156116bb576116ba6114f4565b5b5f6116c884828501611542565b91505092915050565b6116da8161151b565b82525050565b5f6020820190506116f35f8301846116d1565b92915050565b5f80fd5b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61173782611483565b810181811067ffffffffffffffff8211171561175657611755611701565b5b80604052505050565b5f6117686114eb565b9050611774828261172e565b919050565b5f67ffffffffffffffff82111561179357611792611701565b5b61179c82611483565b9050602081019050919050565b828183375f83830152505050565b5f6117c96117c484611779565b61175f565b9050828152602081018484840111156117e5576117e46116fd565b5b6117f08482856117a9565b509392505050565b5f82601f83011261180c5761180b6116f9565b5b813561181c8482602086016117b7565b91505092915050565b5f805f806080858703121561183d5761183c6114f4565b5b5f85013567ffffffffffffffff81111561185a576118596114f8565b5b611866878288016117f8565b945050602085013567ffffffffffffffff811115611887576118866114f8565b5b611893878288016117f8565b93505060406118a487828801611575565b92505060606118b587828801611542565b91505092959194509250565b5f80604083850312156118d7576118d66114f4565b5b5f6118e485828601611542565b92505060206118f585828601611542565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061194357607f821691505b602082108103611956576119556118ff565b5b50919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f6119b660248361144b565b91506119c18261195c565b604082019050919050565b5f6020820190508181035f8301526119e3816119aa565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f611a4460228361144b565b9150611a4f826119ea565b604082019050919050565b5f6020820190508181035f830152611a7181611a38565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f611ad260258361144b565b9150611add82611a78565b604082019050919050565b5f6020820190508181035f830152611aff81611ac6565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f611b6060238361144b565b9150611b6b82611b06565b604082019050919050565b5f6020820190508181035f830152611b8d81611b54565b9050919050565b7f45524332303a20696e73756666696369656e742062616c616e636500000000005f82015250565b5f611bc8601b8361144b565b9150611bd382611b94565b602082019050919050565b5f6020820190508181035f830152611bf581611bbc565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320615f8201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b5f611c5660288361144b565b9150611c6182611bfc565b604082019050919050565b5f6020820190508181035f830152611c8381611c4a565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611cc182611556565b9150611ccc83611556565b9250828203905081811115611ce457611ce3611c8a565b5b92915050565b5f611cf482611556565b9150611cff83611556565b9250828201905080821115611d1757611d16611c8a565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f775f8201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b5f611d7760258361144b565b9150611d8282611d1d565b604082019050919050565b5f6020820190508181035f830152611da481611d6b565b9050919050565b7f6f6e6c7920666163746f72792063616e20696e697400000000000000000000005f82015250565b5f611ddf60158361144b565b9150611dea82611dab565b602082019050919050565b5f6020820190508181035f830152611e0c81611dd3565b9050919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302611e6f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82611e34565b611e798683611e34565b95508019841693508086168417925050509392505050565b5f819050919050565b5f611eb4611eaf611eaa84611556565b611e91565b611556565b9050919050565b5f819050919050565b611ecd83611e9a565b611ee1611ed982611ebb565b848454611e40565b825550505050565b5f90565b611ef5611ee9565b611f00818484611ec4565b505050565b5b81811015611f2357611f185f82611eed565b600181019050611f06565b5050565b601f821115611f6857611f3981611e13565b611f4284611e25565b81016020851015611f51578190505b611f65611f5d85611e25565b830182611f05565b50505b505050565b5f82821c905092915050565b5f611f885f1984600802611f6d565b1980831691505092915050565b5f611fa08383611f79565b9150826002028217905092915050565b611fb982611441565b67ffffffffffffffff811115611fd257611fd1611701565b5b611fdc825461192c565b611fe7828285611f27565b5f60209050601f831160018114612018575f8415612006578287015190505b6120108582611f95565b865550612077565b601f19841661202686611e13565b5f5b8281101561204d57848901518255600182019150602085019450602081019050612028565b8683101561206a5784890151612066601f891682611f79565b8355505b6001600288020188555050505b505050505050565b5f8160011c9050919050565b5f808291508390505b60018511156120d4578086048111156120b0576120af611c8a565b5b60018516156120bf5780820291505b80810290506120cd8561207f565b9450612094565b94509492505050565b5f826120ec57600190506121a7565b816120f9575f90506121a7565b816001811461210f576002811461211957612148565b60019150506121a7565b60ff84111561212b5761212a611c8a565b5b8360020a91508482111561214257612141611c8a565b5b506121a7565b5060208310610133831016604e8410600b841016171561217d5782820a90508381111561217857612177611c8a565b5b6121a7565b61218a848484600161208b565b925090508184048111156121a1576121a0611c8a565b5b81810290505b9392505050565b5f6121b882611556565b91506121c383611556565b92506121f07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846120dd565b905092915050565b5f61220282611556565b915061220d83611556565b925082820261221b81611556565b9150828204841483151761223257612231611c8a565b5b509291505056fea26469706673582212202eea6f03467135b2bd5fdf0b8cdd5562d95661025760e012350aef2215325d6364736f6c63430008160033
Verified Source Code Full Match
Compiler: v0.8.22+commit.4fc1097e
EVM: shanghai
Optimization: No
AIToken.sol 189 lines
// SPDX-License-Identifier: MIT
/*
█████╗ ██╗
██╔══██╗██║
███████║██║
██╔══██║██║
██║ ██║██║
╚═╝ ╚═╝╚═╝
██╗███████╗
██║██╔════╝
██║███████╗
██║╚════██║
██║███████║
╚═╝╚══════╝
██████╗ ███████╗██╗ ██╗
██╔══██╗██╔════╝██║ ██║
██║ ██║█████╗ ██║ ██║
██║ ██║██╔══╝ ╚██╗ ██╔╝
██████╔╝███████╗ ╚████╔╝
╚═════╝ ╚══════╝ ╚═══╝
*/
// This token was generated AND deployed using GPT-4 and DALLE-3 on https://aiis.dev! All tokens deployed from this website adhere to basic Ethereum ERC20 token standards, ensuring secure code and compatibility among the Ethereum ecosystem. Check it out now! https://aiis.dev
pragma solidity ^0.8.9;
import "./Ownable.sol";
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(
address recipient,
uint256 amount
) external returns (bool);
function allowance(
address owner,
address spender
) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract AIToken is IERC20, Ownable {
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private allowances;
address public factory;
constructor() Ownable(_msgSender()){
factory = msg.sender;
}
function initialize(
string memory _name,
string memory _symbol,
uint256 _initialSupply,
address _initialHolder
) external {
require(msg.sender == factory, "only factory can init");
transferOwnership(_initialHolder);
name = _name;
symbol = _symbol;
_totalSupply = _initialSupply * (10 ** uint256(decimals));
_balances[_initialHolder] = _totalSupply;
emit Transfer(address(0), _initialHolder, _totalSupply);
}
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
function balanceOf(
address account
) external view override returns (uint256) {
return _balances[account];
}
function transfer(
address recipient,
uint256 amount
) external override returns (bool) {
require(
msg.sender != address(0),
"ERC20: transfer from the zero address"
);
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_balances[msg.sender] >= amount, "ERC20: insufficient balance");
_balances[msg.sender] -= amount;
_balances[recipient] += amount;
emit Transfer(msg.sender, recipient, amount);
return true;
}
function allowance(
address owner,
address spender
) external view override returns (uint256) {
return allowances[owner][spender];
}
function approve(
address spender,
uint256 amount
) external override returns (bool) {
require(
msg.sender != address(0),
"ERC20: approve from the zero address"
);
require(spender != address(0), "ERC20: approve to the zero address");
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_balances[sender] >= amount, "ERC20: insufficient balance");
require(
allowances[sender][msg.sender] >= amount,
"ERC20: transfer amount exceeds allowance"
);
_balances[sender] -= amount;
_balances[recipient] += amount;
allowances[sender][msg.sender] -= amount;
emit Transfer(sender, recipient, amount);
return true;
}
function increaseAllowance(
address spender,
uint256 addedValue
) public returns (bool) {
_approve(
msg.sender,
spender,
allowances[msg.sender][spender] + addedValue
);
return true;
}
function decreaseAllowance(
address spender,
uint256 subtractedValue
) public returns (bool) {
uint256 currentAllowance = allowances[msg.sender][spender];
require(
currentAllowance >= subtractedValue,
"ERC20: decreased allowance below zero"
);
_approve(msg.sender, spender, currentAllowance - subtractedValue);
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");
allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "./Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
AITokenFactory.sol 42 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "./AIToken.sol";
import "./Ownable.sol";
contract AITokenFactory is Ownable {
uint256 public deploymentFee;
address[] public deployedTokens;
event TokenDeployed(address indexed tokenAddress, address indexed owner);
constructor(uint256 _deploymentFee) Ownable(msg.sender) {
deploymentFee = _deploymentFee;
}
receive() external payable {}
function setDeploymentFee(uint256 _newFee) external onlyOwner {
deploymentFee = _newFee;
}
function createToken(string memory _name, string memory _symbol, uint _initialSupply) public payable returns (address) {
require(msg.value == deploymentFee, "Insufficient fee in ETH");
AIToken newToken = new AIToken(); // No arguments passed to AIToken constructor
newToken.initialize(_name, _symbol, _initialSupply, msg.sender);
deployedTokens.push(address(newToken));
emit TokenDeployed(address(newToken), msg.sender);
return address(newToken);
}
function getDeployedTokens() external view returns (address[] memory) {
return deployedTokens;
}
function withdrawFees(address payable to) external onlyOwner {
uint256 balance = address(this).balance;
require(balance > 0, "No fees to withdraw");
to.transfer(balance);
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
factory 0xc45a0155 → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
initialize 0xbd3a13f6
string _name
string _symbol
uint256 _initialSupply
address _initialHolder
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address