Ethereum Contracts¶
Contract Listing¶
NuCypherToken
ERC20 token contractStakingEscrow
Legacy staking contractAdjudicator
Manages the slashing protocolUpgradeable
Base contract for upgradingDispatcher
Proxy to other contracts and provides upgrading of theStakingEscrow
contractSimplePREApplication
Interim application contract for Threshold networkSubscriptionManager
Holds a policy’s fee and distributes them
Deployment Procedure¶
This section provides a step-by-step guide of how NuCypher contracts are deployed.
Deploy
NuCypherToken
with all future supply tokensDeploy stub for
StakingEscrow
with a dispatcher targeting itDeploy Threshold network contracts
Deploy
StakingEscrow
and retarget its dispatcher by using theupgrade(address)
functionDeploy
SimplePREApplication
contractDeploy
SubscriptionManager
contract
Alice’s Contract Interaction¶
Staking Provider’s Contract Interaction¶
The Staking Provider Bonds to an Operator (“Ursula”)¶
The staking provider must specify an operator who will make a confirmation and sign on behalf of this staking provider by calling the SimplePREApplication.bondOperator(address, address)
method.
Bonding a new operator is allowed no more than once within SimplePREApplication.minOperatorSeconds()
.
Only the operator can make a confirmation.
Ursula Makes a Confirmation¶
In order to make a address confirmation, operators call SimplePREApplication.confirmOperatorAddress()
.
Contracts Versioning¶
Upgradeable contracts, such as StakingEscrow
, have their version specified in contract doc inside @dev.
Version format is |vi.j.k|
, where i
- major version, j
- minor version, k
- patch, for example |v1.2.3|
:
Different major versions mean different forks and they are not upgradeable
Minor versions relate to any signatures or state changes inside contract, contracts are upgradeable between minor versions, but have different ABI and follows different agent layers
Patches involve changes inside function(s) with signature(s) untouched. All patches with a common minor version can be upgraded from one to another without other changes