FlipsideCrypto / badger

EVM primitive, protocol and app layer that exposes top-down management mechanisms for on-chain organizations. Badger is the key to the existing gates and locks within Web3.
https://www.trybadger.com/
MIT License
22 stars 1 forks source link

Account bound functionality #254

Open masonchain opened 11 months ago

masonchain commented 11 months ago

ISSUES

/**
     * See {ERC1155._beforeTokenTransfer}
     * @dev Enables the ability to have modules such as Account Bound, etc.
     */
    function _beforeTokenTransfer(
        address _operator,
        address _from,
        address _to,
        uint256[] memory _ids,
        uint256[] memory _amounts,
        bytes memory _data
    ) internal virtual override {
        /// @dev Before transferring, process any Organization hooks.
        _hook(
            BEFORE_TRANSFER,
            abi.encode(_operator, _from, _to, _ids, _amounts, _data)
        );

        /// @dev Do not call the super as it is an empty function.
    }

So this fat list of args gets passed to _hook, and then _execute, as the data param.

BadgerTransferBound decodes is as:

    /**
     * See {IBadgerHook-execute}.
     */
    function execute(bytes calldata _data) public virtual override {
        /// @dev Decode the transfer data forwarded from the Organization.
        (
            address _operator,
            address _from,
            address _to,
            uint256[] memory _ids,
            ,

        ) = abi.decode(
                _data,
                (address, address, address, uint256[], uint256[], bytes)
            );
netlify[bot] commented 11 months ago

Deploy Preview for badger-frontend ready!

Name Link
Latest commit 529ab1a8257c1c53f5fb5a5ce45b493f0658e4fb
Latest deploy log https://app.netlify.com/sites/badger-frontend/deploys/651deac6dd9c770008602a8a
Deploy Preview https://deploy-preview-254--badger-frontend.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.