Skip to content

Problem: Cannot mint l2 tokens#2

Merged
thomas-nguy merged 12 commits intomainfrom
thomas/add-mint-to-weth9
Jul 7, 2023
Merged

Problem: Cannot mint l2 tokens#2
thomas-nguy merged 12 commits intomainfrom
thomas/add-mint-to-weth9

Conversation

@thomas-nguy
Copy link
Member

@thomas-nguy thomas-nguy commented Jun 23, 2023

  • Draft version with mint function added to WETH contract
  • Fix compilation issue
  • Users can call l1WethBridge.deposit to bridge custom WETH token as gas token in L2

test script: #4

@XinyuCRO XinyuCRO force-pushed the thomas/add-mint-to-weth9 branch from ecf71ee to d669c8d Compare June 29, 2023 09:00

function deposit() public payable {
balanceOf[msg.sender] += msg.value;
// Do not uses
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean don't use deposit and withdraw functions? or don't emit the events?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are keeping those methods to keep retro compability with the interface but since the l2 gas token is not wrapped ethereum, we dont need to use deposit or withdraw anymore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may be able to remove completely those functions actually

return true;
}

function mint(address dest, uint wad) external {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use uint256 instead of uint?

// We allow executing such blocks.

require(block.timestamp > commitBlockTimestamp + executionDelay, "5c"); // The delay is not passed
require(block.timestamp >= commitBlockTimestamp + executionDelay, "5c"); // The delay is not passed
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a small fix to avoid a bug on devnet when executionDelay is set to 0 and the sequencer try to commit and execute block within on tx (it should succeed)

uint256 _l2TxGasPerPubdataByte,
address _refundRecipient
address _refundRecipient,
uint256 _gasAmount
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be l1 amount?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually use the ERC20 bridge do not require l1Amount, we just use the _gasAmount as the l1Amount of requestL2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay can you update the comment then?

@thomas-nguy thomas-nguy merged commit 00ef4df into main Jul 7, 2023
thomas-nguy added a commit that referenced this pull request Jul 18, 2023
Co-authored-by: Xinyu Zhao <xinyu.zhao@crypto.com>
thomas-nguy added a commit that referenced this pull request Jul 18, 2023
Co-authored-by: Xinyu Zhao <xinyu.zhao@crypto.com>
thomas-nguy added a commit that referenced this pull request Jul 20, 2023
Co-authored-by: Xinyu Zhao <xinyu.zhao@crypto.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants