-
Notifications
You must be signed in to change notification settings - Fork 164
Scoping #490
base: release/v1.0.0
Are you sure you want to change the base?
Scoping #490
Conversation
Conflicts: .gitignore README.md contracts/Bridge.sol package-lock.json package.json
|
} | ||
|
||
// if we are dealing with Polygon ERC20 SX bridged over, call SXVault contract to send native SX | ||
if (resourceID == sxResourceID) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
|
if (_burnList[tokenAddress]) { | ||
burnERC20(tokenAddress, depositer, amount); | ||
// 'burn' ERC20 that does not implement ERC20Burnable 'burnFrom()' | ||
manualBurnERC20(tokenAddress, depositer, amount); |
There was a problem hiding this comment.
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
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 the0x000000000000000000000000dEAd
address to support burning of tokens that don't haveburnFrom
.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 resourceId0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
to denote that we want different logic on the dest side instead of the standardERC20Handler
mint logic.Final change unrelated to above is adding a few more events to aid in integration with front-ends.