Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Conversation

mrwillis
Copy link

@mrwillis mrwillis commented Feb 28, 2022

We've made two changes to the handlers to support a 1 way bridge from source chain to destination chain. The first change is changing the way tokens are burnt on the source side. We create a new method manualBurnERC20 which will send tokens to the 0x000000000000000000000000dEAd address to support burning of tokens that don't have burnFrom.

Second change is supporting native asset redemptions on the dest side. We have a custom vault contract that ERC20SxHandler uses to pull assets from. We use a custom resourceId 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF to denote that we want different logic on the dest side instead of the standard ERC20Handler mint logic.

Final change unrelated to above is adding a few more events to aid in integration with front-ends.

@CLAassistant
Copy link

CLAassistant commented Feb 28, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ dankostiuk
❌ akshar
You have signed the CLA already but the status is still pending? Let us recheck it.

@mrwillis mrwillis changed the title Main Dilligence SCoping Feb 28, 2022
@mrwillis mrwillis changed the title Dilligence SCoping Dilligence Scoping Feb 28, 2022
}

// if we are dealing with Polygon ERC20 SX bridged over, call SXVault contract to send native SX
if (resourceID == sxResourceID) {
Copy link
Author

Choose a reason for hiding this comment

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

Change here to support sending native SX from a vault contract


address public _owner;
address public _sxVaultContract;
bytes32 sxResourceID = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
Copy link
Author

Choose a reason for hiding this comment

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

Custom resource ID for sx

@mrwillis
Copy link
Author

mrwillis commented Feb 28, 2022

ERC20SxHandler is deployed on the SX Network side. It is copied from ERC20Handler verbatim except in executeProposal. ERC20Handler is deployed on the source chain side.

@mrwillis mrwillis changed the title Dilligence Scoping Audit scoping Mar 3, 2022
if (_burnList[tokenAddress]) {
burnERC20(tokenAddress, depositer, amount);
// 'burn' ERC20 that does not implement ERC20Burnable 'burnFrom()'
manualBurnERC20(tokenAddress, depositer, amount);
Copy link
Author

Choose a reason for hiding this comment

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

Burn tokens manually instead of using burnFrom

@mrwillis mrwillis changed the title Audit scoping Scoping Mar 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants