EIP-6059: Parent-Governed Nestable Non-Fungible Tokens

This ERC is already in final, but the behavior you see as problematic can easily be solved by having an auto accept mechanism for collections you specify and using it on the _afterAddChild hook. This has been used already in a few collections. Alternatively, you could just that that for all if it fits your use case better.

Here’s a snippet:

    mapping(address => bool) private _autoAcceptCollection;

    function setAutoAcceptCollection(
        address collection
    ) public virtual onlyOwner {
        _autoAcceptCollection[collection] = true;
    }

    function _afterAddChild(
        uint256 tokenId,
        address childAddress,
        uint256 childId,
        bytes memory
    ) internal override {
        // Auto accept children if they are from known collections
        if (_autoAcceptCollection[childAddress]) {
            _acceptChild(
                tokenId,
                _pendingChildren[tokenId].length - 1,
                childAddress,
                childId
            );
        }
    }

RE 998. It is in deed abandoned, and we did consider it before proposing our own EIP. One of the issues we found isthat it tried to solve different problems in a same EIP with 4 implementations. But the real stopper was that we discovered huge security risks when doing bottom up approaches.

This EIP works well to make any NFT from the spec available as child or parent with a single interface, always giving custody to parent. These kind of problems can not be seen easily from just the interface, that’s why we worked for several months on testing this internally and producing a stable sample implementation before proposing for feedback.

If you’re interested, you can find a basic implementation of this ERC on the assets folder, or we also provide a convinient NPM package, very similar to what OpenZeppeling does: @rmrk-team/evm-contracts - npm. It contains core implementations for this and other ERCs (5773 and 6220), with extensions and 3 ready to use implementations of each, for either lazy minting or preminting with ERC20 or native token. Repo is public so feel free to contribute!

1 Like