Execution reverted when calling Registry contract with non-zero value

Hey there. I'm trying to learn more about how meta txs work by playing around with the "01-defender-meta-txs" workshop app. I wondered if I can send ether to the Registry contract from within the MinimalForwarder contract, and such I have modified the buildRequest function in the signer.js file to return " { value: "1", gas: 1e6, nonce, ...input };", basically changing the value attribute to 1. After that, in the relay function of the code that gets uploaded to the autotask I've also changed the return line to " return await forwarder.execute(request, signature, { gasLimit, value: "1" });". Then, I have used the frontend to register a name, transaction gets executed but the internal transaction of calling the register function gets reverted: https://dashboard.tenderly.co/tx/bsc-testnet/0x3695d50e251ca9a12ce4c7d84d6949cd5912fc5da33efbc72d15f22646589395. I have also tried the same thing with a different MinimalForwarder that makes the call to the contract with "msg.value" instead of "req.value", but it still reverts: https://dashboard.tenderly.co/tx/bsc-testnet/0xee6c7c3c937bff0e7a36b5b0e0d491b97b7cf7c8a4c92637a0b7b4470d0a2892. Any idea why is that?

I have managed to fix the issue, the payable modifier wasn't added to the register function and thus calling it with a non-zero value prior to that led to execution reverting.

1 Like