Skip to main content

StrategyRegistry.sol

Details

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()​

Solidity

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns​

NameTypeDescription
_0bytes32undefined

GOVERNANCE_ROLE()​

Solidity

function GOVERNANCE_ROLE() external view returns (bytes32)

Returns​

NameTypeDescription
_0bytes32undefined

MINTER_ROLE()​

Solidity

function MINTER_ROLE() external view returns (bytes32)

Returns​

NameTypeDescription
_0bytes32undefined

PAUSER_ROLE()​

Solidity

function PAUSER_ROLE() external view returns (bytes32)

Returns​

NameTypeDescription
_0bytes32undefined

_tokenIdTracker()​

Solidity

function _tokenIdTracker() external view returns (uint256 _value)

Returns​

NameTypeDescription
_valueuint256undefined

approve(address,uint256)​

Solidity

function approve(address to, uint256 tokenId) external nonpayable
Details

See {IERC721-approve}.

Parameters​

NameTypeDescription
toaddressundefined
tokenIduint256undefined

balanceOf(address)​

Solidity

function balanceOf(address owner) external view returns (uint256)
Details

See {IERC721-balanceOf}.

Parameters​

NameTypeDescription
owneraddressundefined

Returns​

NameTypeDescription
_0uint256undefined

baseURI()​

Solidity

function baseURI() external view returns (string)
Details

Get the base URI

Returns​

NameTypeDescription
_0stringThe base URI of the registry

createStrategy(address,string,string,uint128,uint128)​

Solidity

function createStrategy(address strategyCreator, string strategyName, string execBundle, uint128 maxGasCost, uint128 maxGasPerAction) external nonpayable returns (uint256 newStrategyTokenId)
Details

Create NFT for execution bundle

Parameters​

NameTypeDescription
strategyCreatoraddressundefined
strategyNamestringThe name of the strategy.
execBundlestringThe IPFS reference of the execution bundle.
maxGasCostuint128The maximum gas cost of the strategy.
maxGasPerActionuint128The maximum gas per action of the strategy, in terms of wei / gas.

Returns​

NameTypeDescription
newStrategyTokenIduint256as the token id of the new NFT.

getApproved(uint256)​

Solidity

function getApproved(uint256 tokenId) external view returns (address)
Details

See {IERC721-getApproved}.

Parameters​

NameTypeDescription
tokenIduint256undefined

Returns​

NameTypeDescription
_0addressundefined

getRegisteredStrategy(uint256)​

Solidity

function getRegisteredStrategy(uint256 tokenId) external view returns (struct IStrategyRegistry.RegisteredStrategy)
Details

Get the strategy details by tokenId

Parameters​

NameTypeDescription
tokenIduint256The token id of the strategy

Returns​

NameTypeDescription
_0IStrategyRegistry.RegisteredStrategyThe details of the strategy

getRoleAdmin(bytes32)​

Solidity

function getRoleAdmin(bytes32 role) external view returns (bytes32)
Details

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Parameters​

NameTypeDescription
rolebytes32undefined

Returns​

NameTypeDescription
_0bytes32undefined

grantRole(bytes32,address)​

Solidity

function grantRole(bytes32 role, address account) external nonpayable
Details

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​

NameTypeDescription
rolebytes32undefined
accountaddressundefined

hasRole(bytes32,address)​

Solidity

function hasRole(bytes32 role, address account) external view returns (bool)
Details

Returns true if account has been granted role.

Parameters​

NameTypeDescription
rolebytes32undefined
accountaddressundefined

Returns​

NameTypeDescription
_0boolundefined

hashedEmptyString()​

Solidity

function hashedEmptyString() external view returns (bytes32)

Returns​

NameTypeDescription
_0bytes32undefined

initialize(string)​

Solidity

function initialize(string registry) external nonpayable

Parameters​

NameTypeDescription
registrystringundefined

isApprovedForAll(address,address)​

Solidity

function isApprovedForAll(address owner, address operator) external view returns (bool)
Details

See {IERC721-isApprovedForAll}.

Parameters​

NameTypeDescription
owneraddressundefined
operatoraddressundefined

Returns​

NameTypeDescription
_0boolundefined

maxMaxGasPerAction()​

Solidity

function maxMaxGasPerAction() external view returns (uint256)

Returns​

NameTypeDescription
_0uint256undefined

name()​

Solidity

function name() external view returns (string)
Details

See {IERC721Metadata-name}.

Returns​

NameTypeDescription
_0stringundefined

owner()​

Solidity

function owner() external view returns (address)
Details

Returns the address of the current owner.

Returns​

NameTypeDescription
_0addressundefined

ownerOf(uint256)​

Solidity

function ownerOf(uint256 tokenId) external view returns (address)
Details

See {IERC721-ownerOf}.

Parameters​

NameTypeDescription
tokenIduint256undefined

Returns​

NameTypeDescription
_0addressundefined

pause()​

Solidity

function pause() external nonpayable
Details

Pauses all token transfers. See {ERC721Pausable} and {Pausable-_pause}. Requirements: - the caller must have the PAUSER_ROLE.

paused()​

Solidity

function paused() external view returns (bool)
Details

Returns true if the contract is paused, and false otherwise.

Returns​

NameTypeDescription
_0boolundefined

renounceOwnership()​

Solidity

function renounceOwnership() external nonpayable
Details

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)​

Solidity

function renounceRole(bytes32 role, address account) external nonpayable
Details

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​

NameTypeDescription
rolebytes32undefined
accountaddressundefined

revokeRole(bytes32,address)​

Solidity

function revokeRole(bytes32 role, address account) external nonpayable
Details

Revokes role from account. If account had been granted role, emits a {RoleRevoked} event. Requirements: - the caller must have role's admin role.

Parameters​

NameTypeDescription
rolebytes32undefined
accountaddressundefined

safeTransferFrom(address,address,uint256)​

Solidity

function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable
Details

See {IERC721-safeTransferFrom}.

Parameters​

NameTypeDescription
fromaddressundefined
toaddressundefined
tokenIduint256undefined

safeTransferFrom(address,address,uint256,bytes)​

Solidity

function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) external nonpayable
Details

See {IERC721-safeTransferFrom}.

Parameters​

NameTypeDescription
fromaddressundefined
toaddressundefined
tokenIduint256undefined
_databytesundefined

setApprovalForAll(address,bool)​

Solidity

function setApprovalForAll(address operator, bool approved) external nonpayable
Details

See {IERC721-setApprovalForAll}.

Parameters​

NameTypeDescription
operatoraddressundefined
approvedboolundefined

setGasParameters(uint256,uint128,uint128)​

Solidity

function setGasParameters(uint256 _tokenId, uint128 _maxGasCost, uint128 _maxGasPerAction) external nonpayable
Details

Set the gas parameters for a given strategy

Parameters​

NameTypeDescription
_tokenIduint256The token id of the strategy
_maxGasCostuint128The maximum gas cost of the strategy
_maxGasPerActionuint128The maximum gas per action of the strategy

setMaxMaxGasPerAction(uint256)​

Solidity

function setMaxMaxGasPerAction(uint256 _maxMaxGasPerAction) external nonpayable

Parameters​

NameTypeDescription
_maxMaxGasPerActionuint256undefined

strategies(string)​

Solidity

function strategies(string) external view returns (uint256 id, string name, address owner, string execBundle, uint128 maxGasCost, uint128 maxGasPerAction)

Parameters​

NameTypeDescription
_0stringundefined

Returns​

NameTypeDescription
iduint256undefined
namestringundefined
owneraddressundefined
execBundlestringundefined
maxGasCostuint128undefined
maxGasPerActionuint128undefined

supportsInterface(bytes4)​

Solidity

function supportsInterface(bytes4 interfaceId) external view returns (bool)
Details

See {IERC165-supportsInterface}.

Parameters​

NameTypeDescription
interfaceIdbytes4undefined

Returns​

NameTypeDescription
_0boolundefined

symbol()​

Solidity

function symbol() external view returns (string)
Details

See {IERC721Metadata-symbol}.

Returns​

NameTypeDescription
_0stringundefined

tokenByIndex(uint256)​

Solidity

function tokenByIndex(uint256 index) external view returns (uint256)
Details

See {IERC721Enumerable-tokenByIndex}.

Parameters​

NameTypeDescription
indexuint256undefined

Returns​

NameTypeDescription
_0uint256undefined

tokenIdToExecBundle(uint256)​

Solidity

function tokenIdToExecBundle(uint256) external view returns (string)

Parameters​

NameTypeDescription
_0uint256undefined

Returns​

NameTypeDescription
_0stringundefined

tokenOfOwnerByIndex(address,uint256)​

Solidity

function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256)
Details

See {IERC721Enumerable-tokenOfOwnerByIndex}.

Parameters​

NameTypeDescription
owneraddressundefined
indexuint256undefined

Returns​

NameTypeDescription
_0uint256undefined

tokenURI(uint256)​

Solidity

function tokenURI(uint256 tokenId) external view returns (string)

Parameters​

NameTypeDescription
tokenIduint256undefined

Returns​

NameTypeDescription
_0stringundefined

totalSupply()​

Solidity

function totalSupply() external view returns (uint256)
Details

See {IERC721Enumerable-totalSupply}.

Returns​

NameTypeDescription
_0uint256undefined

transferFrom(address,address,uint256)​

Solidity

function transferFrom(address from, address to, uint256 tokenId) external nonpayable
Details

See {IERC721-transferFrom}.

Parameters​

NameTypeDescription
fromaddressundefined
toaddressundefined
tokenIduint256undefined

transferOwnership(address)​

Solidity

function transferOwnership(address newOwner) external nonpayable
Details

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters​

NameTypeDescription
newOwneraddressundefined

unpause()​

Solidity

function unpause() external nonpayable
Details

Unpauses all token transfers. See {ERC721Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the PAUSER_ROLE.

upgradeTo(address)​

Solidity

function upgradeTo(address newImplementation) external nonpayable
Details

Upgrade the implementation of the proxy to newImplementation. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters​

NameTypeDescription
newImplementationaddressundefined

upgradeToAndCall(address,bytes)​

Solidity

function upgradeToAndCall(address newImplementation, bytes data) external payable
Details

Upgrade the implementation of the proxy to newImplementation, and subsequently execute the function call encoded in data. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters​

NameTypeDescription
newImplementationaddressundefined
databytesundefined

Events​

AdminChanged​

Solidity

event AdminChanged(address previousAdmin, address newAdmin)

Parameters​

NameTypeDescription
previousAdminaddressundefined
newAdminaddressundefined

Approval​

Solidity

event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)

Parameters​

NameTypeDescription
owner indexedaddressundefined
approved indexedaddressundefined
tokenId indexeduint256undefined

ApprovalForAll​

Solidity

event ApprovalForAll(address indexed owner, address indexed operator, bool approved)

Parameters​

NameTypeDescription
owner indexedaddressundefined
operator indexedaddressundefined
approvedboolundefined

BeaconUpgraded​

Solidity

event BeaconUpgraded(address indexed beacon)

Parameters​

NameTypeDescription
beacon indexedaddressundefined

OwnershipTransferred​

Solidity

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters​

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined

Paused​

Solidity

event Paused(address account)

Parameters​

NameTypeDescription
accountaddressundefined

RoleAdminChanged​

Solidity

event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)

Parameters​

NameTypeDescription
role indexedbytes32undefined
previousAdminRole indexedbytes32undefined
newAdminRole indexedbytes32undefined

RoleGranted​

Solidity

event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)

Parameters​

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined

RoleRevoked​

Solidity

event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)

Parameters​

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined

StrategyCreated​

Solidity

event StrategyCreated(address indexed owner, uint256 indexed tokenId, string name)

Parameters​

NameTypeDescription
owner indexedaddressundefined
tokenId indexeduint256undefined
namestringundefined

Transfer​

Solidity

event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)

Parameters​

NameTypeDescription
from indexedaddressundefined
to indexedaddressundefined
tokenId indexeduint256undefined

Unpaused​

Solidity

event Unpaused(address account)

Parameters​

NameTypeDescription
accountaddressundefined

Upgraded​

Solidity

event Upgraded(address indexed implementation)

Parameters​

NameTypeDescription
implementation indexedaddressundefined