ODCutilsvault

GenericVault

A generic vault contract that can hold any type of assets and execute arbitrary transactions

constructor

constructor(address _initialOwner) public

receive

receive() external payable

Emits an event when native coin is received

execute

function execute(address target, bytes data, uint256 value) external returns (bytes)

Executes a state-changing call on a target

Access to this function SHOULD be protected

Parameters

NameTypeDescription
targetaddressContract to call
databytesData sent to the target, including function selector
valueuint256Native coin value sent with the call

executeStatic

function executeStatic(address target, bytes data) external view returns (bytes)

Executes a static call (non state-changing) on a target

Parameters

NameTypeDescription
targetaddressContract to call
databytesData sent to the target, including function selector

isValidSignature

function isValidSignature(bytes32 hash, bytes signature) external view returns (bytes4)

Should return whether the signature provided is valid for the provided data

Parameters

NameTypeDescription
hashbytes32Hash of the data to be signed
signaturebytesSignature byte array associated with hash

onERC721Received

function onERC721Received(address, address, uint256, bytes) external pure returns (bytes4)

_Whenever an {IERC721} tokenId token is transferred to this contract via {IERC721-safeTransferFrom} by operator from from, this function is called.

It must return its Solidity selector to confirm the token transfer. If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.

The selector can be obtained in Solidity with IERC721Receiver.onERC721Received.selector._

onERC1155Received

function onERC1155Received(address, address, uint256, uint256, bytes) external pure returns (bytes4)

_Handles the receipt of a single ERC-1155 token type. This function is called at the end of a safeTransferFrom after the balance has been updated.

NOTE: To accept the transfer, this must return bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) (i.e. 0xf23a6e61, or its own function selector)._

Parameters

NameTypeDescription
address
address
uint256
uint256
bytes

Return Values

NameTypeDescription
[0]bytes4bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) if transfer is allowed

onERC1155BatchReceived

function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external pure returns (bytes4)

_Handles the receipt of a multiple ERC-1155 token types. This function is called at the end of a safeBatchTransferFrom after the balances have been updated.

NOTE: To accept the transfer(s), this must return bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) (i.e. 0xbc197c81, or its own function selector)._

Parameters

NameTypeDescription
address
address
uint256[]
uint256[]
bytes

Return Values

NameTypeDescription
[0]bytes4bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) if transfer is allowed

supportsInterface

function supportsInterface(bytes4 interfaceId) public view returns (bool)

_Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] to learn more about how these ids are created.

This function call must use less than 30 000 gas._

On this page