Replies: 1 comment
-
The following methods should be implemented: function nonces(address owner) external view returns (uint256)
function DOMAIN_SEPARATOR() external view returns (bytes32)
function grantOperatorPermissionsWithSig(
uint256 characterId,
address operator,
uint256 permissionBitMap,
EIP712Signature calldata sig
) external with the EIP712Signature struct: struct EIP712Signature {
uint8 v;
bytes32 r;
bytes32 s;
uint256 deadline;
} The semantics of which are as follows: For all uint256
keccak256(abi.encodePacked(
hex"1901",
DOMAIN_SEPARATOR,
keccak256(abi.encode(
keccak256("grantOperatorPermissions(uint256 characterId,address operator,uint256 permissionBitMap,uint256 nonce,uint256 deadline)"),
characterId,
operator,
permissionBitMap,
nonce,
deadline))
)) where DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes("Web3 Entry Character")),
keccak256('1'),
3737,
address(0xa6f969045641Cf486a747A2688F3a5A6d43cd0D8)
)); the message is the EIP-712 typed structure:
|
Beta Was this translation helpful? Give feedback.
-
Imagine this scenario: a new user sets up an operator. All subsequent interactions, such as follow, like, and post note, will be initiated by the operator on behalf of the user. In other words, the user only needs to interact with the blockchain once during the entire process, which is when calling
grantOperatorPermissions
to set the operator. To do this, they need to add the Crossbell RPC network through MetaMask, sign the transaction, send the transaction to the blockchain network through the RPC node, and pay the gas fees. If their wallet does not have CSB, they will also need to claim it from the faucet.The above process would be tedious, especially for a new user.
If we can make the
grantOperatorPermissionsWithSig
method support meta transactions, users would only need to sign a signature indicating that they want to set up an operator. The relayer would then package this signature into a transaction and send it to the blockchain network to help users set up the operator. This would shield users from the underlying blockchain, making them unaware of RPC and gas fees. Although the transaction gas fee would be paid by the relayer, I believe that DApp developers would be willing to do this for their users at the moment.The
grantOperatorPermissionsWithSig
interface looks like:#106
Beta Was this translation helpful? Give feedback.
All reactions