PolicyManager

details

v6.2.2

notice

Contract holds policy data and locks accrued policy fees

methods

calculateRefundValue(bytes16)

notice

Calculate amount of refund

params

_policyId

Policy id

calculateRefundValue(bytes16,address)

notice

Calculate amount of refund

params

_node

Node

_policyId

Policy id

constructor

details

Put same address in both inputs variables except when migration is happening

notice

Constructor sets address of the escrow contract

params

_escrowDispatcher

Address of escrow dispatcher

_escrowImplementation

Address of escrow implementation

createPolicy(bytes16,address,uint64,address[])

details

Generate policy id before creation

notice

Create policy

params

_endTimestamp

End timestamp of the policy in seconds

_nodes

Nodes that will handle policy

_policyId

Policy id

_policyOwner

Policy owner. Zero address means sender is owner

finishUpgrade(address)

details

the onlyWhileUpgrading modifier works through a call to the parent finishUpgrade

getArrangementInfo(bytes16,uint256)

notice

Return the information about arrangement

getArrangementsLength(bytes16)

notice

Get number of arrangements in the policy

params

_policyId

Policy id

getCurrentPeriod()

returns

_0

Number of current period

getMinFeeRate(address)

notice

Get the minimum acceptable fee rate (set by staker for their associated worker)

getNodeFeeDelta(address,uint16)

notice

Get information about staker’s fee rate

params

_node

Address of staker

_period

Period to get fee delta

getPolicyOwner(bytes16)

notice

Get policy owner

getRevocationHash(bytes16,address)

notice

Get unsigned hash for revocation

params

_node

Node that will be excluded

_policyId

Policy id

returns

_0

Revocation hash, EIP191 version 0x45 (‘E’)

isOwner()

returns

_0

true if msg.sender is the owner of the contract.

migrate(address)

notice

Migrate from the old period length to the new one

params

_node

Node address

owner()

returns

_0

the address of the owner.

ping(address,uint16,uint16,uint16)

notice

Call from StakingEscrow to update node info once per period. Set default feeDelta value for specified period and update node fee

params

_node

Node address

_periodToSetDefault

Period to set

_processedPeriod1

Processed period

_processedPeriod2

Processed period

refund(bytes16)

notice

Refund part of fee by the sponsor

params

_policyId

Policy id

refund(bytes16,address)

notice

Refund part of one node’s fee by the sponsor

params

_node

Node address

_policyId

Policy id

register(address,uint16)

notice

Register a node

params

_node

Node address

_period

Initial period

renounceOwnership()

details

Allows the current owner to relinquish control of the contract.

notice

Renouncing to ownership will leave the contract without an owner. It will not be possible to call the functions with the onlyOwner modifier anymore.

revoke(bytes16,address,bytes)

notice

Revoke policy or arrangement using owner’s signature

params

_node

Node that will be excluded, zero address if whole policy will be revoked

_policyId

Policy id

_signature

Signature of owner, EIP191 version 0x45 (‘E’)

revokeArrangement(bytes16,address)

notice

Revoke arrangement by the sponsor

params

_node

Node that will be excluded

_policyId

Policy id

revokePolicy(bytes16)

notice

Revoke policy by the sponsor

params

_policyId

Policy id

setFeeRateRange(uint128,uint128,uint128)

notice

Set minimum, default & maximum fee rate for all stakers and all policies (‘global fee range’)

setMinFeeRate(uint256)

notice

Set the minimum acceptable fee rate (set by staker for their associated worker)

details

Input value must fall within feeRateRange (global fee range)

transferOwnership(address)

details

Allows the current owner to transfer control of the contract to a newOwner.

params

newOwner

The address to transfer ownership to.

verifyState(address)

details

the onlyWhileUpgrading modifier works through a call to the parent verifyState

withdraw()

notice

Withdraw fee by node

withdraw(address)

notice

Withdraw fee by node

params

_recipient

Recipient of the fee