KeeperRegistry.sol
owned by governance contract
Methods
bondAmount()
function bondAmount() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
bondCoin()
function bondCoin() external view returns (contract IERC20)
Returns
Name | Type | Description |
---|---|---|
_0 | contract IERC20 | undefined |
changeBondAmount(uint256)
function changeBondAmount(uint256 amount) external nonpayable
change bondAmount to a new value.Does not change existing keeper permissions. If the bondAmount is being increased, existing keepers will not be slashed or removed. note, they will still be able to vote until they are slashed.
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | new bondAmount. |
changeMaxKeepers(uint16)
function changeMaxKeepers(uint16 newNumKeepers) external nonpayable
change numKeepers to a new value. If numKeepers is being reduced, this will not remove any keepers, nor will it change orchestrator requirements. However, it will render keeper licenses > maxNumKeepers invalid and their votes will stop counting.
Parameters
Name | Type | Description |
---|---|---|
newNumKeepers | uint16 | undefined |
checkLicense(address)
function checkLicense(address targetAddress) external view returns (uint256 licenseNumber)
returns true if the given address has the power to vote, reverts otherwise. This function is built to be called by the orchestrator.
Parameters
Name | Type | Description |
---|---|---|
targetAddress | address | address to check |
Returns
Name | Type | Description |
---|---|---|
licenseNumber | uint256 | true if the given address has the power to vote, reverts otherwise. |
currentNumKeepers()
function currentNumKeepers() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
denounce(address,uint256)
function denounce(address targetKeeper, uint256 amount) external nonpayable
slashes a keeper, removing their permissions and forfeiting their bond.
Parameters
Name | Type | Description |
---|---|---|
targetKeeper | address | keeper to denounce |
amount | uint256 | amount of bondCoin to slash note that the keeper will only lose their license if, post-slash, their bond held is less than bondAmount. |
freeCoin()
function freeCoin() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
initialize(address,uint256,uint256,uint256)
function initialize(address coinAddress, uint256 keeperTransferDelay, uint256 maxKeepers, uint256 bondSize) external nonpayable
Parameters
Name | Type | Description |
---|---|---|
coinAddress | address | the address of the ERC20 which will be used for bonds; intended to be Steer token. |
keeperTransferDelay | uint256 | the amount of time (in seconds) between when a keeper relinquishes their license and when they can withdraw their funds. Intended to be 2 weeks - 1 month. |
maxKeepers | uint256 | undefined |
bondSize | uint256 | undefined |
join(uint256,uint256)
function join(uint256 licenseNumber, uint256 amount) external nonpayable
this function has three uses: 1. If the caller is a keeper, they can increase their bondHeld by amount. This helps to avoid slashing. 2. If the caller is not a keeper or former keeper, they can attempt to claim a keeper license and become a keeper. 3. If the caller is a former keeper, they can attempt to cancel their leave request, claim a keeper license, and become a keeper. In all 3 cases registry[msg.sender].bondHeld is increased by amount. In the latter 2, msg.sender's bondHeld after the transaction must be >= bondAmount.
Parameters
Name | Type | Description |
---|---|---|
licenseNumber | uint256 | undefined |
amount | uint256 | Amount of bondCoin to be deposited. |
joiningForOwner(address[])
function joiningForOwner(address[] joiners) external nonpayable
setup utility function for owner to add initial keepers. Addresses must each be unique and not hold any bondToken.
Parameters
Name | Type | Description |
---|---|---|
joiners | address[] | array of addresses to become keepers. note that this function will pull bondToken from the owner equal to bondAmount * numJoiners. note that this function assumes that the keeper registry currently has no keepers. It will revert if this assumption fails. |
keeperLicenses(uint256)
function keeperLicenses(uint256) external view returns (address)
Parameters
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
leave()
function leave() external nonpayable
addresses call this after they have queued to leave and waited the requisite amount of time.
maxNumKeepers()
function maxNumKeepers() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
owner()
function owner() external view returns (address)
Returns the address of the current owner.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
queueToLeave()
function queueToLeave() external nonpayable
Allows keepers to queue to leave the registry. Their elevated permissions are immediately revoked, and their funds can be retrieved once the transferDelay has passed. note that this function can only be called by keepers (or, in rare cases, former keepers whose licenses were revoked by a decrease in maxNumKeepers) emits a permissionChanged event if the call succeeds.
registry(address)
function registry(address) external view returns (uint256 bondHeld, uint256 licenseNumber, uint256 leaveTimestamp)
Parameters
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Returns
Name | Type | Description |
---|---|---|
bondHeld | uint256 | undefined |
licenseNumber | uint256 | undefined |
leaveTimestamp | uint256 | 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.
transferDelay()
Slash safety period--if a keeper leaves, this is the amount of time (in seconds) they must wait before they can withdraw their bond.
function transferDelay() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
_0 | 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 |
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 |
withdrawFreeCoin(uint256,address)
function withdrawFreeCoin(uint256 amount, address targetAddress) external nonpayable
withdraws slashed tokens from the vault and sends them to targetAddress.
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | amount of bondCoin to withdraw |
targetAddress | address | address receiving the tokens |
Events
AdminChanged
event AdminChanged(address previousAdmin, address newAdmin)
Parameters
Name | Type | Description |
---|---|---|
previousAdmin | address | undefined |
newAdmin | address | undefined |
BeaconUpgraded
event BeaconUpgraded(address indexed beacon)
Parameters
Name | Type | Description |
---|---|---|
beacon indexed | address | undefined |
LeaveQueued
event LeaveQueued(address indexed keeper, uint256 leaveTimestamp)
Parameters
Name | Type | Description |
---|---|---|
keeper indexed | address | undefined |
leaveTimestamp | uint256 | undefined |
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Parameters
Name | Type | Description |
---|---|---|
previousOwner indexed | address | undefined |
newOwner indexed | address | undefined |
PermissionChanged
event PermissionChanged(address indexed _subject, enum IKeeperRegistry.permissionType indexed _permissionType)
Parameters
Name | Type | Description |
---|---|---|
_subject indexed | address | undefined |
_permissionType indexed | enum IKeeperRegistry.permissionType | undefined |
Upgraded
event Upgraded(address indexed implementation)
Parameters
Name | Type | Description |
---|---|---|
implementation indexed | address | undefined |