Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60a06040 | 16368928 | 684 days ago | IN | 0 ETH | 0.01439314 |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
AccountImplementation
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.17; // Uncomment this line to use console.log // import "hardhat/console.sol"; import "./AccountGuard.sol"; contract AccountImplementation { AccountGuard public immutable guard; modifier authAndWhitelisted(address target, bool asDelegateCall) { (bool canCall, bool isWhitelisted) = guard.canCallAndWhitelisted( address(this), msg.sender, target, asDelegateCall ); require( canCall, "account-guard/no-permit" ); require( isWhitelisted, "account-guard/illegal-target" ); _; } constructor(AccountGuard _guard) { require( address(_guard) != address(0x0), "account-guard/wrong-guard-address" ); guard = _guard; } function send(address _target, bytes calldata _data) external payable authAndWhitelisted(_target, false) { (bool status, ) = (_target).call{value: msg.value}(_data); require(status, "account-guard/call-failed"); } function execute(address _target, bytes memory /* code do not compile with calldata */ _data) external payable authAndWhitelisted(_target, true) returns (bytes32) { // call contract in current context assembly { let succeeded := delegatecall( sub(gas(), 5000), _target, add(_data, 0x20), mload(_data), 0, 32 ) returndatacopy(0, 0, returndatasize()) switch succeeded case 0 { // throw if delegatecall failed revert(0, returndatasize()) } default { return(0, 0x20) } } } receive() external payable { emit FundsRecived(msg.sender, msg.value); } function owner() external view returns (address) { return guard.owners(address(this)); } event FundsRecived(address sender, uint256 amount); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.17; // Uncomment this line to use console.log // import "hardhat/console.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract AccountGuard is Ownable { address factory; uint8 constant WHITELISTED_EXECUTE_MASK = 1; uint8 constant WHITELISTED_SEND_MASK = 2; mapping(address => mapping(address => bool)) private allowed; mapping(address => uint8) private whitelisted; mapping(address => address) public owners; function isWhitelisted(address target) public view returns (bool) { return (whitelisted[target] & WHITELISTED_EXECUTE_MASK) > 0; } function setWhitelist(address target, bool status) external onlyOwner { whitelisted[target] = status ? whitelisted[target] | WHITELISTED_EXECUTE_MASK : whitelisted[target] & ~WHITELISTED_EXECUTE_MASK; } function isWhitelistedSend(address target) public view returns (bool) { return (whitelisted[target] & WHITELISTED_SEND_MASK) > 0; } function setWhitelistSend(address target, bool status) external onlyOwner { whitelisted[target] = status ? whitelisted[target] | WHITELISTED_SEND_MASK : whitelisted[target] & ~WHITELISTED_SEND_MASK; } function canCallAndWhitelisted( address proxy, address operator, address callTarget, bool asDelegateCall ) external view returns (bool, bool) { return ( allowed[operator][proxy], asDelegateCall ? isWhitelisted(callTarget) : isWhitelistedSend(callTarget) ); } function canCall(address target, address operator) external view returns (bool) { return owners[target] == operator || allowed[operator][target]; } function initializeFactory() external { require(factory == address(0), "account-guard/factory-set"); factory = msg.sender; } function permit( address caller, address target, bool allowance ) external { require( allowed[msg.sender][target] || msg.sender == factory, "account-guard/no-permit" ); if (msg.sender == factory) { owners[target] = caller; allowed[target][target] = true; } else { require(owners[target] != caller, "account-guard/cant-deny-owner"); } allowed[caller][target] = allowance; if (allowance) { emit PermissionGranted(caller, target); } else { emit PermissionRevoked(caller, target); } } function changeOwner(address newOwner, address target) external { require(newOwner != address(0), "account-guard/zero-address"); require(owners[target] == msg.sender, "account-guard/only-proxy-owner"); owners[target] = newOwner; allowed[msg.sender][target] = false; allowed[newOwner][target] = true; emit ProxyOwnershipTransferred(newOwner, msg.sender, target); } event ProxyOwnershipTransferred( address indexed newOwner, address indexed oldAddress, address indexed proxy ); event PermissionGranted(address indexed caller, address indexed proxy); event PermissionRevoked(address indexed caller, address indexed proxy); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/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. * * By default, the owner account will be the one that deploys the contract. 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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @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 { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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; } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract AccountGuard","name":"_guard","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FundsRecived","type":"event"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"execute","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"guard","outputs":[{"internalType":"contract AccountGuard","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"send","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a06040523480156200001157600080fd5b5060405162000e6538038062000e65833981810160405281019062000037919062000162565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620000a9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000a0906200021b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1681525050506200023d565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200011682620000e9565b9050919050565b60006200012a8262000109565b9050919050565b6200013c816200011d565b81146200014857600080fd5b50565b6000815190506200015c8162000131565b92915050565b6000602082840312156200017b576200017a620000e4565b5b60006200018b848285016200014b565b91505092915050565b600082825260208201905092915050565b7f6163636f756e742d67756172642f77726f6e672d67756172642d61646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006200020360218362000194565b91506200021082620001a5565b604082019050919050565b600060208201905081810360008301526200023681620001f4565b9050919050565b608051610bf76200026e6000396000818161013401528181610281015281816102a7015261034c0152610bf76000f3fe6080604052600436106100435760003560e01c80631cff79cd146100885780637ceab3b1146100b85780638da5cb5b146100e3578063c89acc861461010e57610083565b36610083577f4c2ffa71705c7e25830709a453da0f6066957bd706c2b7f1b7fc66d3805e92f73334604051610079929190610581565b60405180910390a1005b600080fd5b6100a2600480360381019061009d9190610730565b61012a565b6040516100af91906107a5565b60405180910390f35b3480156100c457600080fd5b506100cd61027f565b6040516100da919061081f565b60405180910390f35b3480156100ef57600080fd5b506100f86102a3565b604051610105919061083a565b60405180910390f35b610128600480360381019061012391906108b5565b610344565b005b60008260016000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f526d1ee303387876040518563ffffffff1660e01b81526004016101919493929190610930565b6040805180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d191906109a1565b9150915081610215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161020c90610a3e565b60405180910390fd5b80610255576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024c90610aaa565b60405180910390fd5b602060008751602089018a6113885a03f43d6000803e806000811461027a5760206000f35b3d6000fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663022914a7306040518263ffffffff1660e01b81526004016102fe919061083a565b602060405180830381865afa15801561031b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033f9190610adf565b905090565b8260008060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f526d1ee303387876040518563ffffffff1660e01b81526004016103a99493929190610930565b6040805180830381865afa1580156103c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e991906109a1565b915091508161042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042490610a3e565b60405180910390fd5b8061046d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046490610aaa565b60405180910390fd5b60008773ffffffffffffffffffffffffffffffffffffffff16348888604051610497929190610b3c565b60006040518083038185875af1925050503d80600081146104d4576040519150601f19603f3d011682016040523d82523d6000602084013e6104d9565b606091505b505090508061051d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161051490610ba1565b60405180910390fd5b5050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061055282610527565b9050919050565b61056281610547565b82525050565b6000819050919050565b61057b81610568565b82525050565b60006040820190506105966000830185610559565b6105a36020830184610572565b9392505050565b6000604051905090565b600080fd5b600080fd5b6105c781610547565b81146105d257600080fd5b50565b6000813590506105e4816105be565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61063d826105f4565b810181811067ffffffffffffffff8211171561065c5761065b610605565b5b80604052505050565b600061066f6105aa565b905061067b8282610634565b919050565b600067ffffffffffffffff82111561069b5761069a610605565b5b6106a4826105f4565b9050602081019050919050565b82818337600083830152505050565b60006106d36106ce84610680565b610665565b9050828152602081018484840111156106ef576106ee6105ef565b5b6106fa8482856106b1565b509392505050565b600082601f830112610717576107166105ea565b5b81356107278482602086016106c0565b91505092915050565b60008060408385031215610747576107466105b4565b5b6000610755858286016105d5565b925050602083013567ffffffffffffffff811115610776576107756105b9565b5b61078285828601610702565b9150509250929050565b6000819050919050565b61079f8161078c565b82525050565b60006020820190506107ba6000830184610796565b92915050565b6000819050919050565b60006107e56107e06107db84610527565b6107c0565b610527565b9050919050565b60006107f7826107ca565b9050919050565b6000610809826107ec565b9050919050565b610819816107fe565b82525050565b60006020820190506108346000830184610810565b92915050565b600060208201905061084f6000830184610559565b92915050565b600080fd5b600080fd5b60008083601f840112610875576108746105ea565b5b8235905067ffffffffffffffff81111561089257610891610855565b5b6020830191508360018202830111156108ae576108ad61085a565b5b9250929050565b6000806000604084860312156108ce576108cd6105b4565b5b60006108dc868287016105d5565b935050602084013567ffffffffffffffff8111156108fd576108fc6105b9565b5b6109098682870161085f565b92509250509250925092565b60008115159050919050565b61092a81610915565b82525050565b60006080820190506109456000830187610559565b6109526020830186610559565b61095f6040830185610559565b61096c6060830184610921565b95945050505050565b61097e81610915565b811461098957600080fd5b50565b60008151905061099b81610975565b92915050565b600080604083850312156109b8576109b76105b4565b5b60006109c68582860161098c565b92505060206109d78582860161098c565b9150509250929050565b600082825260208201905092915050565b7f6163636f756e742d67756172642f6e6f2d7065726d6974000000000000000000600082015250565b6000610a286017836109e1565b9150610a33826109f2565b602082019050919050565b60006020820190508181036000830152610a5781610a1b565b9050919050565b7f6163636f756e742d67756172642f696c6c6567616c2d74617267657400000000600082015250565b6000610a94601c836109e1565b9150610a9f82610a5e565b602082019050919050565b60006020820190508181036000830152610ac381610a87565b9050919050565b600081519050610ad9816105be565b92915050565b600060208284031215610af557610af46105b4565b5b6000610b0384828501610aca565b91505092915050565b600081905092915050565b6000610b238385610b0c565b9350610b308385846106b1565b82840190509392505050565b6000610b49828486610b17565b91508190509392505050565b7f6163636f756e742d67756172642f63616c6c2d6661696c656400000000000000600082015250565b6000610b8b6019836109e1565b9150610b9682610b55565b602082019050919050565b60006020820190508181036000830152610bba81610b7e565b905091905056fea26469706673582212201d1698a8a0d1b995e507b6bb1aafdd8737d0b93524f1ac7a9898737e8dc03f0664736f6c63430008110033000000000000000000000000ce91349d2a4577bbd0fc91fe6019600e047f2847
Deployed Bytecode
0x6080604052600436106100435760003560e01c80631cff79cd146100885780637ceab3b1146100b85780638da5cb5b146100e3578063c89acc861461010e57610083565b36610083577f4c2ffa71705c7e25830709a453da0f6066957bd706c2b7f1b7fc66d3805e92f73334604051610079929190610581565b60405180910390a1005b600080fd5b6100a2600480360381019061009d9190610730565b61012a565b6040516100af91906107a5565b60405180910390f35b3480156100c457600080fd5b506100cd61027f565b6040516100da919061081f565b60405180910390f35b3480156100ef57600080fd5b506100f86102a3565b604051610105919061083a565b60405180910390f35b610128600480360381019061012391906108b5565b610344565b005b60008260016000807f000000000000000000000000ce91349d2a4577bbd0fc91fe6019600e047f284773ffffffffffffffffffffffffffffffffffffffff1663f526d1ee303387876040518563ffffffff1660e01b81526004016101919493929190610930565b6040805180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d191906109a1565b9150915081610215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161020c90610a3e565b60405180910390fd5b80610255576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024c90610aaa565b60405180910390fd5b602060008751602089018a6113885a03f43d6000803e806000811461027a5760206000f35b3d6000fd5b7f000000000000000000000000ce91349d2a4577bbd0fc91fe6019600e047f284781565b60007f000000000000000000000000ce91349d2a4577bbd0fc91fe6019600e047f284773ffffffffffffffffffffffffffffffffffffffff1663022914a7306040518263ffffffff1660e01b81526004016102fe919061083a565b602060405180830381865afa15801561031b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033f9190610adf565b905090565b8260008060007f000000000000000000000000ce91349d2a4577bbd0fc91fe6019600e047f284773ffffffffffffffffffffffffffffffffffffffff1663f526d1ee303387876040518563ffffffff1660e01b81526004016103a99493929190610930565b6040805180830381865afa1580156103c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e991906109a1565b915091508161042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042490610a3e565b60405180910390fd5b8061046d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161046490610aaa565b60405180910390fd5b60008773ffffffffffffffffffffffffffffffffffffffff16348888604051610497929190610b3c565b60006040518083038185875af1925050503d80600081146104d4576040519150601f19603f3d011682016040523d82523d6000602084013e6104d9565b606091505b505090508061051d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161051490610ba1565b60405180910390fd5b5050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061055282610527565b9050919050565b61056281610547565b82525050565b6000819050919050565b61057b81610568565b82525050565b60006040820190506105966000830185610559565b6105a36020830184610572565b9392505050565b6000604051905090565b600080fd5b600080fd5b6105c781610547565b81146105d257600080fd5b50565b6000813590506105e4816105be565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61063d826105f4565b810181811067ffffffffffffffff8211171561065c5761065b610605565b5b80604052505050565b600061066f6105aa565b905061067b8282610634565b919050565b600067ffffffffffffffff82111561069b5761069a610605565b5b6106a4826105f4565b9050602081019050919050565b82818337600083830152505050565b60006106d36106ce84610680565b610665565b9050828152602081018484840111156106ef576106ee6105ef565b5b6106fa8482856106b1565b509392505050565b600082601f830112610717576107166105ea565b5b81356107278482602086016106c0565b91505092915050565b60008060408385031215610747576107466105b4565b5b6000610755858286016105d5565b925050602083013567ffffffffffffffff811115610776576107756105b9565b5b61078285828601610702565b9150509250929050565b6000819050919050565b61079f8161078c565b82525050565b60006020820190506107ba6000830184610796565b92915050565b6000819050919050565b60006107e56107e06107db84610527565b6107c0565b610527565b9050919050565b60006107f7826107ca565b9050919050565b6000610809826107ec565b9050919050565b610819816107fe565b82525050565b60006020820190506108346000830184610810565b92915050565b600060208201905061084f6000830184610559565b92915050565b600080fd5b600080fd5b60008083601f840112610875576108746105ea565b5b8235905067ffffffffffffffff81111561089257610891610855565b5b6020830191508360018202830111156108ae576108ad61085a565b5b9250929050565b6000806000604084860312156108ce576108cd6105b4565b5b60006108dc868287016105d5565b935050602084013567ffffffffffffffff8111156108fd576108fc6105b9565b5b6109098682870161085f565b92509250509250925092565b60008115159050919050565b61092a81610915565b82525050565b60006080820190506109456000830187610559565b6109526020830186610559565b61095f6040830185610559565b61096c6060830184610921565b95945050505050565b61097e81610915565b811461098957600080fd5b50565b60008151905061099b81610975565b92915050565b600080604083850312156109b8576109b76105b4565b5b60006109c68582860161098c565b92505060206109d78582860161098c565b9150509250929050565b600082825260208201905092915050565b7f6163636f756e742d67756172642f6e6f2d7065726d6974000000000000000000600082015250565b6000610a286017836109e1565b9150610a33826109f2565b602082019050919050565b60006020820190508181036000830152610a5781610a1b565b9050919050565b7f6163636f756e742d67756172642f696c6c6567616c2d74617267657400000000600082015250565b6000610a94601c836109e1565b9150610a9f82610a5e565b602082019050919050565b60006020820190508181036000830152610ac381610a87565b9050919050565b600081519050610ad9816105be565b92915050565b600060208284031215610af557610af46105b4565b5b6000610b0384828501610aca565b91505092915050565b600081905092915050565b6000610b238385610b0c565b9350610b308385846106b1565b82840190509392505050565b6000610b49828486610b17565b91508190509392505050565b7f6163636f756e742d67756172642f63616c6c2d6661696c656400000000000000600082015250565b6000610b8b6019836109e1565b9150610b9682610b55565b602082019050919050565b60006020820190508181036000830152610bba81610b7e565b905091905056fea26469706673582212201d1698a8a0d1b995e507b6bb1aafdd8737d0b93524f1ac7a9898737e8dc03f0664736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ce91349d2a4577bbd0fc91fe6019600e047f2847
-----Decoded View---------------
Arg [0] : _guard (address): 0xCe91349d2A4577BBd0fC91Fe6019600e047f2847
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ce91349d2a4577bbd0fc91fe6019600e047f2847
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.