StrategyRegistry.sol
All strategies are registered through this contract.This is where strategy bundles are stored as well as the offline data needed to decode parameters stored on a vault.
Methods
DEFAULT_ADMIN_ROLE()
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
GOVERNANCE_ROLE()
function GOVERNANCE_ROLE() external view returns (bytes32)
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
MINTER_ROLE()
function MINTER_ROLE() external view returns (bytes32)
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
PAUSER_ROLE()
function PAUSER_ROLE() external view returns (bytes32)
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
_tokenIdTracker()
function _tokenIdTracker() external view returns (uint256 _value)
Returns
Name | Type | Description |
---|---|---|
_value | uint256 | undefined |
approve(address,uint256)
function approve(address to, uint256 tokenId) external nonpayable
See {IERC721-approve}.
Parameters
Name | Type | Description |
---|---|---|
to | address | undefined |
tokenId | uint256 | undefined |
balanceOf(address)
function balanceOf(address owner) external view returns (uint256)
See {IERC721-balanceOf}.
Parameters
Name | Type | Description |
---|---|---|
owner | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
baseURI()
function baseURI() external view returns (string)
Get the base URI
Returns
Name | Type | Description |
---|---|---|
_0 | string | The base URI of the registry |
createStrategy(address,string,string,uint128,uint128)
function createStrategy(address strategyCreator, string strategyName, string execBundle, uint128 maxGasCost, uint128 maxGasPerAction) external nonpayable returns (uint256 newStrategyTokenId)
Create NFT for execution bundle
Parameters
Name | Type | Description |
---|---|---|
strategyCreator | address | undefined |
strategyName | string | The name of the strategy. |
execBundle | string | The IPFS reference of the execution bundle. |
maxGasCost | uint128 | The maximum gas cost of the strategy. |
maxGasPerAction | uint128 | The maximum gas per action of the strategy, in terms of wei / gas. |
Returns
Name | Type | Description |
---|---|---|
newStrategyTokenId | uint256 | as the token id of the new NFT. |
getApproved(uint256)
function getApproved(uint256 tokenId) external view returns (address)
See {IERC721-getApproved}.
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
getRegisteredStrategy(uint256)
function getRegisteredStrategy(uint256 tokenId) external view returns (struct IStrategyRegistry.RegisteredStrategy)
Get the strategy details by tokenId
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | The token id of the strategy |
Returns
Name | Type | Description |
---|---|---|
_0 | IStrategyRegistry.RegisteredStrategy | The details of the strategy |
getRoleAdmin(bytes32)
function getRoleAdmin(bytes32 role) external view returns (bytes32)
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
grantRole(bytes32,address)
function grantRole(bytes32 role, address account) external nonpayable
Grants role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
hasRole(bytes32,address)
function hasRole(bytes32 role, address account) external view returns (bool)
Returns true
if account
has been granted role
.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
hashedEmptyString()
function hashedEmptyString() external view returns (bytes32)
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
initialize(string)
function initialize(string registry) external nonpayable
Parameters
Name | Type | Description |
---|---|---|
registry | string | undefined |
isApprovedForAll(address,address)
function isApprovedForAll(address owner, address operator) external view returns (bool)
See {IERC721-isApprovedForAll}.
Parameters
Name | Type | Description |
---|---|---|
owner | address | undefined |
operator | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
maxMaxGasPerAction()
function maxMaxGasPerAction() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
name()
function name() external view returns (string)
See {IERC721Metadata-name}.
Returns
Name | Type | Description |
---|---|---|
_0 | string | undefined |
owner()
function owner() external view returns (address)
Returns the address of the current owner.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
ownerOf(uint256)
function ownerOf(uint256 tokenId) external view returns (address)
See {IERC721-ownerOf}.
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
pause()
function pause() external nonpayable
Pauses all token transfers. See {ERC721Pausable} and {Pausable-_pause}. Requirements: - the caller must have the PAUSER_ROLE
.
paused()
function paused() external view returns (bool)
Returns true if the contract is paused, and false otherwise.
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
renounceOwnership()
function renounceOwnership() external nonpayable
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.
renounceRole(bytes32,address)
function renounceRole(bytes32 role, address account) external nonpayable
Revokes role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
revokeRole(bytes32,address)
function revokeRole(bytes32 role, address account) external nonpayable
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
safeTransferFrom(address,address,uint256)
function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable
See {IERC721-safeTransferFrom}.
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
See {IERC721-safeTransferFrom}.
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
See {IERC721-setApprovalForAll}.
Parameters
Name | Type | Description |
---|---|---|
operator | address | undefined |
approved | bool | undefined |
setGasParameters(uint256,uint128,uint128)
function setGasParameters(uint256 _tokenId, uint128 _maxGasCost, uint128 _maxGasPerAction) external nonpayable
Set the gas parameters for a given strategy
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The token id of the strategy |
_maxGasCost | uint128 | The maximum gas cost of the strategy |
_maxGasPerAction | uint128 | The maximum gas per action of the strategy |
setMaxMaxGasPerAction(uint256)
function setMaxMaxGasPerAction(uint256 _maxMaxGasPerAction) external nonpayable
Parameters
Name | Type | Description |
---|---|---|
_maxMaxGasPerAction | uint256 | undefined |
strategies(string)
function strategies(string) external view returns (uint256 id, string name, address owner, string execBundle, uint128 maxGasCost, uint128 maxGasPerAction)
Parameters
Name | Type | Description |
---|---|---|
_0 | string | undefined |
Returns
Name | Type | Description |
---|---|---|
id | uint256 | undefined |
name | string | undefined |
owner | address | undefined |
execBundle | string | undefined |
maxGasCost | uint128 | undefined |
maxGasPerAction | uint128 | undefined |
supportsInterface(bytes4)
function supportsInterface(bytes4 interfaceId) external view returns (bool)
See {IERC165-supportsInterface}.
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
symbol()
function symbol() external view returns (string)
See {IERC721Metadata-symbol}.
Returns
Name | Type | Description |
---|---|---|
_0 | string | undefined |
tokenByIndex(uint256)
function tokenByIndex(uint256 index) external view returns (uint256)
See {IERC721Enumerable-tokenByIndex}.
Parameters
Name | Type | Description |
---|---|---|
index | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
tokenIdToExecBundle(uint256)
function tokenIdToExecBundle(uint256) external view returns (string)
Parameters
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | string | undefined |
tokenOfOwnerByIndex(address,uint256)
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256)
See {IERC721Enumerable-tokenOfOwnerByIndex}.
Parameters
Name | Type | Description |
---|---|---|
owner | address | undefined |
index | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | 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)
See {IERC721Enumerable-totalSupply}.
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
transferFrom(address,address,uint256)
function transferFrom(address from, address to, uint256 tokenId) external nonpayable
See {IERC721-transferFrom}.
Parameters
Name | Type | Description |
---|---|---|
from | address | undefined |
to | address | undefined |
tokenId | uint256 | undefined |
transferOwnership(address)
function transferOwnership(address newOwner) external nonpayable
Transfers ownership of the contract to a new account (newOwner
). Can only be called by the current owner.
Parameters
Name | Type | Description |
---|---|---|
newOwner | address | undefined |
unpause()
function unpause() external nonpayable
Unpauses all token transfers. See {ERC721Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the PAUSER_ROLE
.
upgradeTo(address)
function upgradeTo(address newImplementation) external nonpayable
Upgrade the implementation of the proxy to newImplementation
. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.
Parameters
Name | Type | Description |
---|---|---|
newImplementation | address | undefined |
upgradeToAndCall(address,bytes)
function upgradeToAndCall(address newImplementation, bytes data) external payable
Upgrade the implementation of the proxy to newImplementation
, and subsequently execute the function call encoded in data
. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.
Parameters
Name | Type | Description |
---|---|---|
newImplementation | address | undefined |
data | bytes | undefined |
Events
AdminChanged
event AdminChanged(address previousAdmin, address newAdmin)
Parameters
Name | Type | Description |
---|---|---|
previousAdmin | address | undefined |
newAdmin | address | undefined |
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 |
BeaconUpgraded
event BeaconUpgraded(address indexed beacon)
Parameters
Name | Type | Description |
---|---|---|
beacon indexed | address | undefined |
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Parameters
Name | Type | Description |
---|---|---|
previousOwner indexed | address | undefined |
newOwner indexed | address | undefined |
Paused
event Paused(address account)
Parameters
Name | Type | Description |
---|---|---|
account | address | undefined |
RoleAdminChanged
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
Parameters
Name | Type | Description |
---|---|---|
role indexed | bytes32 | undefined |
previousAdminRole indexed | bytes32 | undefined |
newAdminRole indexed | bytes32 | undefined |
RoleGranted
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
Parameters
Name | Type | Description |
---|---|---|
role indexed | bytes32 | undefined |
account indexed | address | undefined |
sender indexed | address | undefined |
RoleRevoked
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
Parameters
Name | Type | Description |
---|---|---|
role indexed | bytes32 | undefined |
account indexed | address | undefined |
sender indexed | address | undefined |
StrategyCreated
event StrategyCreated(address indexed owner, uint256 indexed tokenId, string name)
Parameters
Name | Type | Description |
---|---|---|
owner indexed | address | undefined |
tokenId indexed | uint256 | undefined |
name | string | 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 |
Unpaused
event Unpaused(address account)
Parameters
Name | Type | Description |
---|---|---|
account | address | undefined |
Upgraded
event Upgraded(address indexed implementation)
Parameters
Name | Type | Description |
---|---|---|
implementation indexed | address | undefined |