reference contract
decessor.sol
The EIP-7702 delegate target behind Decessor, in Solidity ^0.8.24 with no dependencies. The sandbox runs js/sim.js, which mirrors it function by function and is unit tested against it.
Notice
Reference implementation, not audited. Do not delegate an address holding anything of value to this code. The production address and code hash will be announced only by @DecessorETH.
Storage layout
Under EIP-7702 the code runs in your account's own storage, so Decessor keeps everything in one namespaced struct (ERC-7201) instead of low slots another delegate might use.
namespace decessor.storage.v1
slot S 0xfa8125a9fac28d1f6f4b05fe454526c3d5323babf90eb8663d81994abd87e200
S successors.length
keccak256(S) + i successors[i]
S + 1 silence (uint64) | lastSeen (uint64) | graceEnd (uint64) | claimant (uint8)
S + 2 controller (address, 0 until take())
The 7702 flow
- Decessor is deployed once. Its runtime code hash is what you verify.
- You sign an EIP-7702 authorization for it. Your account's code becomes
0xef0100followed by the Decessor address. - You call
configure()on your own address: the call arrives withmsg.sender == address(this), which is how the code knows it is you. - Every owner call resets
lastSeenand cancels any pending claim. - After the silence, a successor calls
claim(); after 30 days of grace,take(). - To leave, authorize the zero address. Your account becomes a plain EOA again.
Source
The complete file, exactly as shipped in contracts/Decessor.sol.
Loading Decessor.sol…