-
Notifications
You must be signed in to change notification settings - Fork 277
Description
Current AllocationRegistry is the output of nucypher-deploy allocations and is a JSON file containing a dictionary of beneficiary addresses and "contract data", which is just a tuple of a contract address (i.e. the UserEscrow address for that beneficary) and the corresponding contract ABI.
Some inefficiencies of such design for the allocation registry:
- The contract ABI is the same for all
UserEscrowcontracts, so the registry is very redundant. - It presumes that the same file that is the output of
nucypher-deploy allocationswill be used by allocation users whennucypher stake, which is not very convenient. - The file contains the beneficiary address and
UserEscrowaddress of all allocation users, which is only marginally useful for the deployer, but not for allocation users.
The work in #1227 that introduced UserEscrow staking with the CLI continues to use said design for AllocationRegistry as a compromise to not change too much in a single PR, but this must change in a subsequent PR, part of the biznaga EPIC.
Proposal
-
Instead/In addition of current
allocation_registry.jsonfile, thenucypher-deploycommand will output:- A file with just the ABI of the
UserEscrowcontract, which recall it's the same for all allocation users. Let's call this fileallocation_contract_ABI.json. - A small file for each allocation user containing the beneficiary address and the corresponding
UserEscrowcontract address. Let's call this fileallocation_user_0xfoobar.json, where0xfoobaris the beneficiary.
- A file with just the ABI of the
-
allocation-contract-ABI.jsonis uploaded to the "master registry repo" (currently in GH), together with the contract registry (contract_registry.json). -
allocation_user_0xfoobar.jsonis sent to the allocation user0xfoobar. -
When allocation users stake using
nucypher stake, they'll have to provide either:- Both the
--beneficiary-address 0xfoobarand--contract-address 0xabc123 - A path to an
allocation_user_0xfoobar.jsonfile, which recall contains just a tuple with the beneficiary andUserEscrowcontract addresses.
- Both the
Any comment or alternative proposal is welcome!