hyperlane-xyz / fuel-contracts

5 stars 2 forks source link

Warp route: implement HypERC20 in Sway #69

Closed tkporter closed 6 months ago

tkporter commented 1 year ago

Should live in a new repo probably? or maybe in hyperlane-token

Should include:

Note that tokens are first-class citizens in the FuelVM, and we should be minting / burning using the functions provided in the std lib. Balances are also denominated as u64s, not uint256s, which means that these warp route tokens probably need to have different token decimals than their remote counterparts :| https://fuellabs.github.io/sway/v0.23.0/blockchain-development/native_assets.html for context

I asked them what their native ERC20 bridge will be doing and got this as a response:

It's not set in stone yet, but 18 decimals seems to be most common [on L1 Ethereum] which will be converted to 9 [decimals] on Fuel. Anything less than 9 [decimals, like USDC's 6 decimals] we'll probably just match

Build in such a way such that HypERC20Collateral can tap into things easily as well

Also check out https://github.com/FuelLabs/rfcs/issues/13 for the frc 20 standard

nambrot commented 1 year ago

@tkporter is this still open?

avious00 commented 1 year ago

@nambrot @tkporter is this still open?

tkporter commented 6 months ago

for posterity, there's an unmerged pr https://github.com/hyperlane-xyz/hyperlane-token-fuel/pull/2