plasma icon indicating copy to clipboard operation
plasma copied to clipboard

Investigate support for ERC20 tokens

Open federicobond opened this issue 7 years ago • 7 comments

federicobond avatar Feb 22 '18 12:02 federicobond

What is this token for? Deposited ETH on Plasma chain? So the PlasmaETH will be ERC-20 token? I wanna know some underlying discussion.

shogochiai avatar Mar 13 '18 15:03 shogochiai

Current implementation - master branch - supports ETH. You deposit ETH and use PlasmaCoin as ETH on plasma chain.

This pull request #17 implements token ERC20 instead of ETH. You can deposit defined token (check constructor argument which defines main chain's token address https://github.com/jdkanani/plasma/blob/c189d9808763abe69067277c66dab55b66187c4f/contracts/RootChain.sol#L82) and PlasmaCoin will represent that token on plasma chain.

jdkanani avatar Mar 13 '18 15:03 jdkanani

Okay so on master, both deposit and PlasmaCoin are ETH. On PR #17, deposit is ETH and PlasmaCoin is "PlasmaWP-mentioned block withholding attack desincentivizing token".

So this ERC-20 token must be used for transaction fee, and PoS validation reward, right?

shogochiai avatar Mar 13 '18 16:03 shogochiai

With #17 you can deposit tokens from an ERC-20 compatible token contract defined in the RootChain constructor a get a UTXO for that token in the Plasma chain.

federicobond avatar Mar 13 '18 16:03 federicobond

Deposit is gonna be arbitrary ERC-20 token, PlasmaCoin will represent that Plasma chain's token, okay.

And this PlasmaCoin will be re-implemented on each child Plasma chain, but this repo is gonna be template/framework for building offspring chains, hence no need to reinvent wheel, right?

shogochiai avatar Mar 13 '18 16:03 shogochiai

That's right, a new contract instance must be deployed for each token you want to support.

federicobond avatar Mar 13 '18 18:03 federicobond

The rootchain is expensive, hence for example nth-depth PlasmaChain's PlasmaCoin(ERC-20 based) is not able to be processed & defined on the rootchain contract.

Then I guestimated that (n-1)th PlasmaChain might have an ability to define Plasma contract for nth PlasmaChain, and this PlasmaCoin is not defined on the rootchain.

For enabling that, this repo must have EVM to define&process PlasmaContract, rather thab on the rootchain PlasmaContract. CMIIW.

shogochiai avatar Mar 14 '18 01:03 shogochiai