Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bridge] bug - TokenVault unable to send message with processingFee > 0 #276

Closed
cyberhorsey opened this issue Nov 15, 2022 · 0 comments · Fixed by #277
Closed

[bridge] bug - TokenVault unable to send message with processingFee > 0 #276

cyberhorsey opened this issue Nov 15, 2022 · 0 comments · Fixed by #277

Comments

@cyberhorsey
Copy link
Contributor

in Bridge.sol when we check the .sendMessage call from TokenVault, we have this check:

        uint256 expectedAmount = message.depositValue +
            message.callValue +
            message.processingFee;
        require(expectedAmount == msg.value, "B:value");

however, when we call it from TokenVault.sendEther, we do this:

        message.gasLimit = gasLimit;
        message.processingFee = processingFee;
        message.depositValue = msg.value;
        message.refundAddress = refundAddress;
        message.memo = memo;

        // Ether are held by the Bridge on L1 and by the EtherVault on L2, not
        // the TokenVault
        bytes32 signal = IBridge(resolve("bridge")).sendMessage{
            value: msg.value
        }(message);

ie: it is imposible for msg.value to be equal to the message.deposit + call + processing amount, because depositValue on message is ALWAYS set to msg.value.

@cyberhorsey cyberhorsey self-assigned this Nov 15, 2022
@cyberhorsey cyberhorsey changed the title [protocol] bug - TokenVault unable to send message with processingFee > 0 [bridge] bug - TokenVault unable to send message with processingFee > 0 Nov 15, 2022
@cyberhorsey cyberhorsey moved this to 📝 Todo in Taiko Project Board Nov 15, 2022
Repository owner moved this from 📝 Todo to ✅ Done in Taiko Project Board Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
1 participant