Skip to main content

KeeperRegistry.sol

Details

owned by governance contract

Methods

bondAmount()

Solidity

function bondAmount() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

bondCoin()

Solidity

function bondCoin() external view returns (contract IERC20)

Returns

NameTypeDescription
_0contract IERC20undefined

changeBondAmount(uint256)

Solidity

function changeBondAmount(uint256 amount) external nonpayable
Details

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

NameTypeDescription
amountuint256new bondAmount.

changeMaxKeepers(uint16)

Solidity

function changeMaxKeepers(uint16 newNumKeepers) external nonpayable
Details

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

NameTypeDescription
newNumKeepersuint16undefined

checkLicense(address)

Solidity

function checkLicense(address targetAddress) external view returns (uint256 licenseNumber)
Details

returns true if the given address has the power to vote, reverts otherwise. This function is built to be called by the orchestrator.

Parameters

NameTypeDescription
targetAddressaddressaddress to check

Returns

NameTypeDescription
licenseNumberuint256true if the given address has the power to vote, reverts otherwise.

currentNumKeepers()

Solidity

function currentNumKeepers() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

denounce(address,uint256)

Solidity

function denounce(address targetKeeper, uint256 amount) external nonpayable
Details

slashes a keeper, removing their permissions and forfeiting their bond.

Parameters

NameTypeDescription
targetKeeperaddresskeeper to denounce
amountuint256amount of bondCoin to slash note that the keeper will only lose their license if, post-slash, their bond held is less than bondAmount.

freeCoin()

Solidity

function freeCoin() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

initialize(address,uint256,uint256,uint256)

Solidity

function initialize(address coinAddress, uint256 keeperTransferDelay, uint256 maxKeepers, uint256 bondSize) external nonpayable

Parameters

NameTypeDescription
coinAddressaddressthe address of the ERC20 which will be used for bonds; intended to be Steer token.
keeperTransferDelayuint256the 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.
maxKeepersuint256undefined
bondSizeuint256undefined

join(uint256,uint256)

Solidity

function join(uint256 licenseNumber, uint256 amount) external nonpayable
Details

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

NameTypeDescription
licenseNumberuint256undefined
amountuint256Amount of bondCoin to be deposited.

joiningForOwner(address[])

Solidity

function joiningForOwner(address[] joiners) external nonpayable
Details

setup utility function for owner to add initial keepers. Addresses must each be unique and not hold any bondToken.

Parameters

NameTypeDescription
joinersaddress[]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)

Solidity

function keeperLicenses(uint256) external view returns (address)

Parameters

NameTypeDescription
_0uint256undefined

Returns

NameTypeDescription
_0addressundefined

leave()

Solidity

function leave() external nonpayable
Details

addresses call this after they have queued to leave and waited the requisite amount of time.

maxNumKeepers()

Solidity

function maxNumKeepers() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

owner()

Solidity

function owner() external view returns (address)
Details

Returns the address of the current owner.

Returns

NameTypeDescription
_0addressundefined

queueToLeave()

Solidity

function queueToLeave() external nonpayable
Details

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)

Solidity

function registry(address) external view returns (uint256 bondHeld, uint256 licenseNumber, uint256 leaveTimestamp)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
bondHelduint256undefined
licenseNumberuint256undefined
leaveTimestampuint256undefined

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.

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.

Solidity

function transferDelay() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

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

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

withdrawFreeCoin(uint256,address)

Solidity

function withdrawFreeCoin(uint256 amount, address targetAddress) external nonpayable
Details

withdraws slashed tokens from the vault and sends them to targetAddress.

Parameters

NameTypeDescription
amountuint256amount of bondCoin to withdraw
targetAddressaddressaddress receiving the tokens

Events

AdminChanged

Solidity

event AdminChanged(address previousAdmin, address newAdmin)

Parameters

NameTypeDescription
previousAdminaddressundefined
newAdminaddressundefined

BeaconUpgraded

Solidity

event BeaconUpgraded(address indexed beacon)

Parameters

NameTypeDescription
beacon indexedaddressundefined

LeaveQueued

Solidity

event LeaveQueued(address indexed keeper, uint256 leaveTimestamp)

Parameters

NameTypeDescription
keeper indexedaddressundefined
leaveTimestampuint256undefined

OwnershipTransferred

Solidity

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined

PermissionChanged

Solidity

event PermissionChanged(address indexed _subject, enum IKeeperRegistry.permissionType indexed _permissionType)

Parameters

NameTypeDescription
_subject indexedaddressundefined
_permissionType indexedenum IKeeperRegistry.permissionTypeundefined

Upgraded

Solidity

event Upgraded(address indexed implementation)

Parameters

NameTypeDescription
implementation indexedaddressundefined