Skip to main content

CSEarlyAdoption

CSEarlyAdoption.sol is the supplementary contract responsible for the Early Adoption members' verification. It validates if the address is eligible to create a Node Operator during the Early Adoption period or if the address is eligible to create a Node Operator with the discounted bond curve once the Early Adoption period is over. It stores information about eligible addresses that have already been used to create a Node Operator.

Upgradability

The contract is immutable.

State Variables

TREE_ROOT

Root of the EA members Merkle Tree

bytes32 public immutable TREE_ROOT;

CURVE_ID

Id of the bond curve to be assigned for the EA members

uint256 public immutable CURVE_ID;

MODULE

Address of the Staking Module using Early Adoption contract

address public immutable MODULE;

Functions

consume

Validate EA eligibility proof and mark it as consumed

Called only by the module

function consume(address member, bytes32[] calldata proof) external;

Parameters

NameTypeDescription
memberaddressAddress to be verified alongside the proof
proofbytes32[]Merkle proof of EA eligibility

isConsumed

Check if the address has already consumed EA access

function isConsumed(address member) external view returns (bool);

Parameters

NameTypeDescription
memberaddressAddress to check

Returns

NameTypeDescription
<none>boolConsumed flag

verifyProof

Check is the address is eligible to consume EA access

function verifyProof(address member, bytes32[] calldata proof) public view returns (bool);

Parameters

NameTypeDescription
memberaddressAddress to check
proofbytes32[]Merkle proof of EA eligibility

Returns

NameTypeDescription
<none>boolBoolean flag if the proof is valid or not

hashLeaf

Get a hash of a leaf in EA Merkle tree

Double hash the leaf to prevent second preimage attacks

function hashLeaf(address member) public pure returns (bytes32);

Parameters

NameTypeDescription
memberaddressEA member address

Returns

NameTypeDescription
<none>bytes32Hash of the leaf

Events

Consumed

event Consumed(address indexed member);