Agent

Ethereum Browse chains

0x40907540d8a6c65c637785e8f8b742ae6b0b9968

Proxy implementation: 0x3a93c17fc82cc33420d1809dda9fb715cc89dd37

Solidity v0.4.24+commit.e67f0147

🤖
Query this contract from your AI
Reference: 0x40907540d8a6c65c637785e8f8b742ae6b0b9968
Sample prompt: "Tell me the current state of eth/0x40907540d8a6c65c637785e8f8b742ae6b0b9968"
No AI wired up yet? → mcp.smarts.md · Browse chains

Admin & Risk

Who can change the rules?

Detected upgradeable controls from the verified ABI.

Upgradeable

Current controls

Implementation
0x3a93c17fc82cc33420d1809dda9fb715cc89dd37 ↗ Etherscan → smarts proxy

Overview

Read Functions
33
Write Functions
12
Events
11

Read Functions

Block #26,159,483 · just now
ADD_PROTECTED_TOKEN_ROLE() view → 0x6eb2a499556bfa2872f5aa15812b956cc4a71b4d64eb3553f7073c7e41415aaa

Return the role identifier used to grant or verify the protected token role.✨ AI

Returns

Name Type Description
— bytes32 bytes32 role identifier for the PROTECTED_TOKEN role used with AccessControl to grant or check permissions.✨ AI
supportsInterface(_interfaceId: bytes4) pure

Tells whether this contract supports a given ERC-165 interface

dev: Implements conformance to ERC-165

Parameters

Name Type Description
_interfaceId bytes4 Interface bytes to check

Returns

Name Type Description
— bool True if this contract supports the interface
hasInitialized() view → true

Indicates whether the contract has completed its one-time initialization.✨ AI

Returns

Name Type Description
— bool Whether the contract has been initialized by the time of the current block
ERC1271_INTERFACE_ID() view → 0xfb855dc9

Returns the ERC-1271 interface identifier used to indicate the contract supports signature verification.✨ AI

Returns

Name Type Description
— bytes4 bytes4: ERC-1271 interface identifier constant used to signal support for isValidSignature verification.✨ AI
isValidSignature(_hash: bytes32, _signature: bytes) view

Validate a signature for the provided data and return the ERC-1271 magic value.✨ AI

dev: Function must be implemented by deriving contract

Parameters

Name Type Description
_hash bytes32 Arbitrary length data signed on the behalf of address(this)
_signature bytes Signature byte array associated with _data

Returns

Name Type Description
— bytes4 A bytes4 magic value 0x20c13b0b if the signature check passes, 0x00000000 if not MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5) MUST allow external calls
ERC1271_RETURN_INVALID_SIGNATURE() view → 0x00000000

Returns the bytes4 indicator that the contract uses to represent an invalid ERC1271 signature.✨ AI

Returns

Name Type Description
— bytes4 The bytes4 value used to indicate an invalid ERC1271 signature result.✨ AI
TRANSFER_ROLE() view → 0x8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c

Returns the role identifier used to authorize asset transfer operations.✨ AI

Returns

Name Type Description
— bytes32 The bytes32 role identifier (hash) for TRANSFER_ROLE, used to check or grant transfer permissions.✨ AI
isValidSignature(_data: bytes, _signature: bytes) view

Validate a signature for the provided data and return the ERC-1271 magic value.✨ AI

dev: Function must be implemented by deriving contract

Parameters

Name Type Description
_data bytes Message or data blob that was signed.✨ AI
_signature bytes Signature byte array associated with _data

Returns

Name Type Description
— bytes4 A bytes4 magic value 0x20c13b0b if the signature check passes, 0x00000000 if not MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5) MUST allow external calls
getProtectedTokensLength() view → 0

Return the number of protected tokens tracked by the Agent contract.✨ AI

Returns

Name Type Description
— uint256 Number of protected tokens stored in the contract.✨ AI
getEVMScriptExecutor(_script: bytes) view

Return the executor address responsible for running a given EVM script.✨ AI

Parameters

Name Type Description
_script bytes Serialized EVM script bytes used to determine the appropriate executor.✨ AI

Returns

Name Type Description
— address Address of the executor contract that can run the provided script, or the zero address if no executor is registered.✨ AI
getRecoveryVault() view → 0x0000000000000000000000000000000000000000

Returns the address of the contract's recovery vault.✨ AI

dev: Get the recovery vault for the app

Returns

Name Type Description
— address Recovery vault address for the app
RUN_SCRIPT_ROLE() view → 0xb421f7ad7646747f3051c50c0b8e2377839296cd4973e27f63821d73e390338f

Get the role identifier used to authorize execution of runScript operations.✨ AI

Returns

Name Type Description
— bytes32 The bytes32 constant identifying the RUN_SCRIPT role used in access control checks.✨ AI
SAFE_EXECUTE_ROLE() view → 0x0a1ad7b87f5846153c6d5a1f761d71c7d0cfd122384f56066cd33239b7933694

Returns the bytes32 identifier for the SAFE_EXECUTE_ROLE role.✨ AI

Returns

Name Type Description
— bytes32 Bytes32 role identifier used to grant or verify the SAFE_EXECUTE_ROLE.✨ AI
REMOVE_PROTECTED_TOKEN_ROLE() view → 0x71eee93d500f6f065e38b27d242a756466a00a52a1dbcd6b4260f01a8640402a

Return the role identifier used to authorize removing protected tokens.✨ AI

Returns

Name Type Description
— bytes32 bytes32 role identifier constant for REMOVE_PROTECTED_TOKEN_ROLE✨ AI
isDepositable() view → true

Checks whether the agent currently accepts new deposits.✨ AI

Returns

Name Type Description
— bool True if the contract currently accepts deposits; false otherwise.✨ AI
DESIGNATE_SIGNER_ROLE() view → 0x23ce341656c3f14df6692eebd4757791e33662b7dcf9970c8308303da5472b7c

Return the bytes32 role identifier used to grant or check designate-signer permissions.✨ AI

Returns

Name Type Description
— bytes32 The bytes32 role identifier constant representing the DESIGNATE_SIGNER_ROLE.✨ AI
EXECUTE_ROLE() view → 0xcebf517aa4440d1d125e0355aae64401211d0848a23c02cc5d29a14822580ba4

Returns the role identifier required to execute agent actions.✨ AI

Returns

Name Type Description
— bytes32 The bytes32 role identifier that grants permission to execute actions.✨ AI
allowRecoverability(address) view

Check whether the Agent allows recovering a specific token or ETH.✨ AI

dev: By default deriving from AragonApp makes it recoverable

Parameters

Name Type Description
— address

Returns

Name Type Description
— bool bool whether the app allows the recovery
appId() view → 0x9ac98dc5f995bf0211ed589ef022719d1487e5cb2bab505676f0d084c07cf89a

Returns the app identifier associated with this Agent.✨ AI

Returns

Name Type Description
— bytes32 The bytes32 application identifier that uniquely identifies the Agent's application or protocol.✨ AI
protectedTokens(uint256) view

Return the address of a protected token at the specified index.✨ AI

Parameters

Name Type Description
— uint256

Returns

Name Type Description
— address Address of the protected token located at the provided index.✨ AI
getInitializationBlock() view → 10,647,744

Returns the block number when the contract was initialized.✨ AI

Returns

Name Type Description
— uint256 Block number in which the contract was initialized
ERC1271_RETURN_VALID_SIGNATURE() view → 0x20c13b0b

Return the ERC-1271 magic value that indicates a valid contract signature.✨ AI

Returns

Name Type Description
— bytes4 The 4-byte ERC-1271 value (magic return) used to signal a valid signature.✨ AI
canPerform(_sender: address, _role: bytes32, _params: uint256[]) view

Check whether a given sender is allowed to perform the specified role under the provided parameters.✨ AI

dev: Check whether an action can be performed by a sender for a particular role on this app

Parameters

Name Type Description
_sender address Sender of the call
_role bytes32 Role on this app
_params uint256[] Permission params for the role

Returns

Name Type Description
— bool Boolean indicating whether the sender has the permissions to perform the action. Always returns false if the app hasn't been initialized yet.
getEVMScriptRegistry() view → 0x1b13e8e7b85b2f92ca4436f98f88ce169f63d567

Return the address of the contract registered as the EVM script registry.✨ AI

Returns

Name Type Description
— address The address of the EVMScriptRegistry contract used to resolve and execute EVM scripts.✨ AI
designatedSigner() view → 0x0000000000000000000000000000000000000000

Returns the address designated as the contract's signer.✨ AI

Returns

Name Type Description
— address The address currently configured as the designated signer for this Agent contract.✨ AI
PROTECTED_TOKENS_CAP() view → 10

Returns the cap on the number of protected tokens.✨ AI

Returns

Name Type Description
— uint256 The cap value (uint256) representing the maximum number of protected tokens.✨ AI
ADD_PRESIGNED_HASH_ROLE() view → 0x0b29780bb523a130b3b01f231ef49ed2fa2781645591a0b0a44ca98f15a5994c

Returns the bytes32 identifier for the ADD_PRESIGNED_HASH_ROLE role.✨ AI

Returns

Name Type Description
— bytes32 The bytes32 role identifier used to grant or check the ADD_PRESIGNED_HASH_ROLE permission.✨ AI
isPresigned(bytes32) view

Check whether a given 32-byte hash has been pre-signed by this agent.✨ AI

Parameters

Name Type Description
— bytes32

Returns

Name Type Description
— bool True if the provided hash corresponds to a recorded pre-signed authorization; otherwise false.✨ AI
canForward(_sender: address, _evmScript: bytes) view

Tells whether `_sender` can forward actions or not

dev: IForwarder interface conformance

Parameters

Name Type Description
_sender address Address of the account intending to forward an action
_evmScript bytes

Returns

Name Type Description
— bool True if the given address can run scripts, false otherwise
kernel() view → 0xad06868167bc5ac5cfcbef2cafa82bc76961d72d

Return the address of the Kernel contract associated with this Agent.✨ AI

Returns

Name Type Description
— address The address of the Kernel contract linked to this Agent.✨ AI
isPetrified() view → false

Return whether the Agent is currently petrified.✨ AI

Returns

Name Type Description
— bool True if the Agent is petrified, false otherwise.✨ AI
balance(_token: address) view

Return the Agent's token balance for the specified token address.✨ AI

Parameters

Name Type Description
_token address The token contract address to query.✨ AI

Returns

Name Type Description
— uint256 The token balance held by the Agent, expressed in the token's smallest unit (e.g., wei).✨ AI
isForwarder() pure → true

Tells whether the Agent app is a forwarder or not

dev: IForwarder interface conformance

Returns

Name Type Description
— bool Always true

Write Functions

onERC721Received(_operator: address, _from: address, _tokenId: uint256, _data: bytes) nonpayable

Handle the receipt of an NFT

dev: The ERC721 smart contract calls this function on the recipient after a {IERC721-safeTransferFrom}. This function MUST return the function selector, otherwise the caller will revert the transaction. The selector to be returned can be obtained as `this.onERC721Received.selector`. This function MAY throw to revert and reject the transfer. Note: the ERC721 contract address is always the message sender.

Parameters

Name Type Description
_operator address
_from address
_tokenId uint256
_data bytes

Returns

Name Type Description
— bytes4 bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
deposit(_token: address, _value: uint256) payable

Deposit `_value` `_token` to the vault

Parameters

Name Type Description
_token address Address of the token being transferred
_value uint256 Amount of tokens being transferred
presignHash(_hash: bytes32) nonpayable

Pre-sign hash `_hash`

Parameters

Name Type Description
_hash bytes32 Hash that will be considered signed regardless of the signature checked with 'isValidSignature()'
removeProtectedToken(_token: address) nonpayable

Remove `_token.symbol(): string` from the list of protected tokens

Parameters

Name Type Description
_token address Address of the token to be unprotected
addProtectedToken(_token: address) nonpayable

Add `_token.symbol(): string` to the list of protected tokens

Parameters

Name Type Description
_token address Address of the token to be protected
initialize() nonpayable

Initialize Vault app

dev: As an AragonApp it needs to be initialized in order for roles (`auth` and `authP`) to work
transferToVault(_token: address) nonpayable

Send funds to recovery Vault. This contract should never receive funds, but in case it does, this function allows one to recover them.

Parameters

Name Type Description
_token address Token balance to be sent to recovery vault.
setDesignatedSigner(_designatedSigner: address) nonpayable

Set `_designatedSigner` as the designated signer of the app, which will be able to sign messages on behalf of the app

Parameters

Name Type Description
_designatedSigner address Address that will be able to sign messages on behalf of the app
safeExecute(_target: address, _data: bytes) nonpayable

Execute '`@radspec(_target, _data)`' on `_target`, ensuring that protected tokens can't be spent

Parameters

Name Type Description
_target address Address where the action is being executed
_data bytes Calldata for the action
execute(_target: address, _ethValue: uint256, _data: bytes) nonpayable

Execute '`@radspec(_target, _data)`' on `_target``_ethValue == 0 ? '' : ' (Sending ' + @tokenAmount(0x0000000000000000000000000000000000000000, _ethValue) + ')'`

Parameters

Name Type Description
_target address Address where the action is being executed
_ethValue uint256 Amount of ETH from the contract that is sent with the action
_data bytes Calldata for the action
transfer(_token: address, _to: address, _value: uint256) nonpayable

Parameters

Name Type Description
_token address
_to address
_value uint256
forward(_evmScript: bytes) nonpayable

Execute the script as the Agent app

dev: IForwarder interface conformance. Forwards any token holder action.

Parameters

Name Type Description
_evmScript bytes Script being executed

Events

SafeExecute(sender: address, target: address, data: bytes)
Name Type Indexed Description
sender address ✓
target address ✓
data bytes
Execute(sender: address, target: address, ethValue: uint256, data: bytes)
Name Type Indexed Description
sender address ✓
target address ✓
ethValue uint256
data bytes
AddProtectedToken(token: address)
Name Type Indexed Description
token address ✓
RemoveProtectedToken(token: address)
Name Type Indexed Description
token address ✓
PresignHash(sender: address, hash: bytes32)
Name Type Indexed Description
sender address ✓
hash bytes32 ✓
SetDesignatedSigner(sender: address, oldSigner: address, newSigner: address)
Name Type Indexed Description
sender address ✓
oldSigner address ✓
newSigner address ✓
ReceiveERC721(token: address, operator: address, from: address, tokenId: uint256, data: bytes)
Name Type Indexed Description
token address ✓
operator address ✓
from address ✓
tokenId uint256
data bytes
VaultTransfer(token: address, to: address, amount: uint256)
Name Type Indexed Description
token address ✓
to address ✓
amount uint256
VaultDeposit(token: address, sender: address, amount: uint256)
Name Type Indexed Description
token address ✓
sender address ✓
amount uint256
ScriptResult(executor: address, script: bytes, input: bytes, returnData: bytes)
Name Type Indexed Description
executor address ✓
script bytes
input bytes
returnData bytes
RecoverToVault(vault: address, token: address, amount: uint256)
Name Type Indexed Description
vault address ✓
token address ✓
amount uint256