// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; }} abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _setOwner(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); }} contract FeeContract is Ownable { uint public initialFee; mapping(address => bool) public paidFee; mapping(address => uint) public paidFeeBlock; event AccountActivated(address indexed account); event ActivationFeeChanged(uint indexed previousFee, uint indexed newFee); function changeFee(uint newFee) external onlyOwner { uint previousFee = initialFee; initialFee = newFee; emit ActivationFeeChanged(previousFee, newFee); } function pay() external payable { address sender = msg.sender; uint value = msg.value; require(paidFee[sender] != true, "G000"); require(value >= initialFee, "G001"); paidFee[sender] = true; paidFeeBlock[sender] = block.number; if (value > initialFee) { payable(sender).transfer(value - initialFee); } emit AccountActivated(sender); }}
[{"name": "AccountActivated", "type": "event", "inputs": [{"name": "account", "type": "address", "indexed": true, "internalType": "address"}], "anonymous": false}, {"name": "ActivationFeeChanged", "type": "event", "inputs": [{"name": "previousFee", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "newFee", "type": "uint256", "indexed": true, "internalType": "uint256"}], "anonymous": false}, {"name": "OwnershipTransferred", "type": "event", "inputs": [{"name": "previousOwner", "type": "address", "indexed": true, "internalType": "address"}, {"name": "newOwner", "type": "address", "indexed": true, "internalType": "address"}], "anonymous": false}, {"name": "changeFee", "type": "function", "inputs": [{"name": "newFee", "type": "uint256", "internalType": "uint256"}], "outputs": [], "stateMutability": "nonpayable"}, {"name": "initialFee", "type": "function", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"name": "owner", "type": "function", "inputs": [], "outputs": [{"name": "", "type": "address", "internalType": "address"}], "stateMutability": "view"}, {"name": "paidFee", "type": "function", "inputs": [{"name": "", "type": "address", "internalType": "address"}], "outputs": [{"name": "", "type": "bool", "internalType": "bool"}], "stateMutability": "view"}, {"name": "paidFeeBlock", "type": "function", "inputs": [{"name": "", "type": "address", "internalType": "address"}], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"name": "pay", "type": "function", "inputs": [], "outputs": [], "stateMutability": "payable"}, {"name": "renounceOwnership", "type": "function", "inputs": [], "outputs": [], "stateMutability": "nonpayable"}, {"name": "transferOwnership", "type": "function", "inputs": [{"name": "newOwner", "type": "address", "internalType": "address"}], "outputs": [], "stateMutability": "nonpayable"}]
0x60806040526004361061007b5760003560e01c806385cb04651161004e57806385cb0465146101045780638da5cb5b1461013f5780639c00316e14610167578063f2fde38b1461017d57600080fd5b80631b9265b814610080578063591a726f1461008a5780636a1db1bf146100cf578063715018a6146100ef575b600080fd5b61008861019d565b005b34801561009657600080fd5b506100ba6100a536600461046d565b60026020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b3480156100db57600080fd5b506100886100ea36600461049d565b6102e9565b3480156100fb57600080fd5b5061008861034c565b34801561011057600080fd5b5061013161011f36600461046d565b60036020526000908152604090205481565b6040519081526020016100c6565b34801561014b57600080fd5b506000546040516001600160a01b0390911681526020016100c6565b34801561017357600080fd5b5061013160015481565b34801561018957600080fd5b5061008861019836600461046d565b610382565b33600081815260026020526040902054349060ff1615156001036101f55760405162461bcd60e51b81526004016101ec906020808252600490820152630473030360e41b604082015260600190565b60405180910390fd5b6001548110156102305760405162461bcd60e51b81526004016101ec906020808252600490820152634730303160e01b604082015260600190565b6001600160a01b0382166000908152600260209081526040808320805460ff191660019081179091556003909252909120439055548111156102b157816001600160a01b03166108fc6001548361028791906104b6565b6040518115909202916000818181858888f193505050501580156102af573d6000803e3d6000fd5b505b6040516001600160a01b038316907fcfacdcf9289f1b69c533dda67fc14bae036114cd912d8f9fa9676e95d4ec028490600090a25050565b6000546001600160a01b031633146103135760405162461bcd60e51b81526004016101ec906104dd565b6001805490829055604051829082907f423ebc668569f7b038607398feb70f9248fe8722178a1f31cb670fff7835570790600090a35050565b6000546001600160a01b031633146103765760405162461bcd60e51b81526004016101ec906104dd565b610380600061041d565b565b6000546001600160a01b031633146103ac5760405162461bcd60e51b81526004016101ec906104dd565b6001600160a01b0381166104115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101ec565b61041a8161041d565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561047f57600080fd5b81356001600160a01b038116811461049657600080fd5b9392505050565b6000602082840312156104af57600080fd5b5035919050565b818103818111156104d757634e487b7160e01b600052601160045260246000fd5b92915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea264697066735822122040fd68993625ed1c6bd6b2761068d322127fc345c467ac61118876207ca37ce364736f6c63430008130033