IStrategyRegistry.sol
Methods
addressToString(address)
function addressToString(address _address) external pure returns (string)
Parameters
| Name | Type | Description |
|---|---|---|
| _address | address | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined |
approve(address,uint256)
function approve(address to, uint256 tokenId) external nonpayable
Gives permission to to to transfer tokenId token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - The caller must own the token or be an approved operator. - tokenId must exist. Emits an {Approval} event.
Parameters
| Name | Type | Description |
|---|---|---|
| to | address | undefined |
| tokenId | uint256 | undefined |
balanceOf(address)
function balanceOf(address owner) external view returns (uint256 balance)
Returns the number of tokens in owner's account.
Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| balance | uint256 | undefined |
baseURI()
function baseURI() external view returns (string)
Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined |
burn(uint256)
function burn(uint256 tokenId) external nonpayable
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | undefined |
createStrategy(address,string,string,uint128,uint128)
function createStrategy(address strategyCreator, string name, string execBundle, uint128 maxGasCost, uint128 maxGasPerAction) external nonpayable returns (uint256 newStrategyTokenId)
Create NFT for execution bundle.
Parameters
| Name | Type | Description |
|---|---|---|
| strategyCreator | address | undefined |
| name | string | The name of the strategy. |
| execBundle | string | The IPFS reference of the execution bundle. |
| maxGasCost | uint128 | undefined |
| maxGasPerAction | uint128 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| newStrategyTokenId | uint256 | The token ID of the NFT. |
getApproved(uint256)
function getApproved(uint256 tokenId) external view returns (address operator)
Returns the account approved for tokenId token. Requirements: - tokenId must exist.
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| operator | address | undefined |
getRegisteredStrategy(uint256)
function getRegisteredStrategy(uint256 tokenId) external view returns (struct IStrategyRegistry.RegisteredStrategy)
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | IStrategyRegistry.RegisteredStrategy | undefined |
getStrategyAddress(uint256)
function getStrategyAddress(uint256 tokenId) external view returns (address)
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
getStrategyOwner(uint256)
function getStrategyOwner(uint256 tokenId) external view returns (address)
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
isApprovedForAll(address,address)
function isApprovedForAll(address owner, address operator) external view returns (bool)
Returns if the operator is allowed to manage all of the assets of owner. See {setApprovalForAll}
Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined |
| operator | address | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined |
ownerOf(uint256)
function ownerOf(uint256 tokenId) external view returns (address owner)
Returns the owner of the tokenId token. Requirements: - tokenId must exist.
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| owner | address | undefined |
pause()
function pause() external nonpayable
Pauses all token transfers. See {ERC721Pausable} and {Pausable-_pause}. Requirements: - the caller must have the PAUSER_ROLE.
safeTransferFrom(address,address,uint256)
function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable
Safely transfers tokenId token from from to to, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. Requirements: - from cannot be the zero address. - to cannot be the zero address. - tokenId token must exist and be owned by from. - If the caller is not from, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. - If to refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.
Parameters
| Name | Type | Description |
|---|---|---|
| from | address | undefined |
| to | address | undefined |
| tokenId | uint256 | undefined |
safeTransferFrom(address,address,uint256,bytes)
function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable
Safely transfers tokenId token from from to to. Requirements: - from cannot be the zero address. - to cannot be the zero address. - tokenId token must exist and be owned by from. - If the caller is not from, it must be approved to move this token by either {approve} or {setApprovalForAll}. - If to refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.
Parameters
| Name | Type | Description |
|---|---|---|
| from | address | undefined |
| to | address | undefined |
| tokenId | uint256 | undefined |
| data | bytes | undefined |
setApprovalForAll(address,bool)
function setApprovalForAll(address operator, bool _approved) external nonpayable
Approve or remove operator as an operator for the caller. Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. Requirements: - The operator cannot be the caller. Emits an {ApprovalForAll} event.
Parameters
| Name | Type | Description |
|---|---|---|
| operator | address | undefined |
| _approved | bool | undefined |
setGasParameters(uint256,uint128,uint128,uint16)
function setGasParameters(uint256 _tokenId, uint128 _maxGasCost, uint128 _maxGasPerMethod, uint16 _maxMethods) external nonpayable
parameters users set for what constitutes an acceptable use of their funds. Can only be set by NFT owner.
Parameters
| Name | Type | Description |
|---|---|---|
| _tokenId | uint256 | is the token ID of the execution bundle. |
| _maxGasCost | uint128 | is highest acceptable price to pay per gas, in terms of gwei. |
| _maxGasPerMethod | uint128 | is max amount of gas to be sent in one method. |
| _maxMethods | uint16 | is the maximum number of methods that can be executed in one action. |
supportsInterface(bytes4)
function supportsInterface(bytes4 interfaceId) external 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[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
Parameters
| Name | Type | Description |
|---|---|---|
| interfaceId | bytes4 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined |
tokenByIndex(uint256)
function tokenByIndex(uint256 index) external view returns (uint256)
Returns a token ID at a given index of all the tokens stored by the contract. Use along with {totalSupply} to enumerate all tokens.
Parameters
| Name | Type | Description |
|---|---|---|
| index | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
tokenOfOwnerByIndex(address,uint256)
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId)
Returns a token ID owned by owner at a given index of its token list. Use along with {balanceOf} to enumerate all of owner's tokens.
Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined |
| index | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | undefined |
tokenURI(uint256)
function tokenURI(uint256 tokenId) external view returns (string)
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined |
totalSupply()
function totalSupply() external view returns (uint256)
Returns the total amount of tokens stored by the contract.
Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
transferFrom(address,address,uint256)
function transferFrom(address from, address to, uint256 tokenId) external nonpayable
Transfers tokenId token from from to to. WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. Requirements: - from cannot be the zero address. - to cannot be the zero address. - tokenId token must be owned by from. - If the caller is not from, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event.
Parameters
| Name | Type | Description |
|---|---|---|
| from | address | undefined |
| to | address | undefined |
| tokenId | uint256 | undefined |
unpause()
function unpause() external nonpayable
Unpauses all token transfers. See {ERC721Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the PAUSER_ROLE.
Events
Approval
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)
Parameters
| Name | Type | Description |
|---|---|---|
owner indexed | address | undefined |
approved indexed | address | undefined |
tokenId indexed | uint256 | undefined |
ApprovalForAll
event ApprovalForAll(address indexed owner, address indexed operator, bool approved)
Parameters
| Name | Type | Description |
|---|---|---|
owner indexed | address | undefined |
operator indexed | address | undefined |
| approved | bool | undefined |
Transfer
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)
Parameters
| Name | Type | Description |
|---|---|---|
from indexed | address | undefined |
to indexed | address | undefined |
tokenId indexed | uint256 | undefined |