@jay, Iāve been implementing the Cruna protocol and have used the ERC6551Registry to deploy an NFTās manager for each tokenID in a Cruna Vault. This experience led me to realize that the applicability of ERC6551 might extend far beyond merely linking wallets to an NFT. In fact, it seems capable of associating any relevant entity with a tokenId.
However, thereās a challenge Iāve encountered: contracts bound using ERC6551 may not feasibly implement the IERC6551Account
interface due to the constraints posed by the receive
function. Additionally, such contracts might not require signer validation functionality. Their primary need is access to the tokenās data.
To address this, I propose an amendment to the protocol. I suggest introducing a new intermediary interface, IERC6551Bond
, which could look something like this:
interface IERC6551Bound {
function token() external view
returns (uint256 chainId, address tokenContract, uint256 tokenId);
}
This interface would specifically define a contract as bonded to an NFT and facilitate access to the NFTās data.
In an ideal scenario, IERC6551Account
would be an extension of IERC6551Bond
, perhaps as follows:
interface IERC6551Account is IERC6551Bound {
receive() external payable;
function state() external view returns (uint256);
function isValidSigner(address signer, bytes calldata context)
external
view
returns (bytes4 magicValue);
}
What do you think?
PS > If you like the idea, I can raise a PR in the erc6551/reference implementation and in the ERC itself.
PS2 > I think that IERC6551Accountās interfaceId should remain the same since the selectors ar XOR-ed and the interface contains the same selectors.
PS3 > I just realized that it would be also better if in the case of a simple bond, the registry emits a different event ā it looks unlikely to pass. Maybe I have to make a new proposalā¦