Skip to content

Add a function to convert an ACL Param to uint256 #427

@leftab

Description

@leftab

Currently, ACL parameters are created with the Param struct:

struct Param {
    uint8 id;
    uint8 op;
    uint240 value;
}

but the ACL grantPermissionP function takes a uint256[] for its parameters:

function grantPermissionP(address _entity, address _app, bytes32 _role, uint256[] _params)

It could be interesting to have a helper function to convert a Param struct to uint256.
Something like this:

function encodeParam(uint8 id, uint8 op, uint240 value) internal pure returns (uint256) {
    return uint256(id) << 248 | uint256(op) << 240 | value;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions