Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions on Polygon mintable assets #123

Open
hiroshi-yamamoto-dublr opened this issue Sep 11, 2022 · 1 comment
Open

Questions on Polygon mintable assets #123

hiroshi-yamamoto-dublr opened this issue Sep 11, 2022 · 1 comment

Comments

@hiroshi-yamamoto-dublr
Copy link

I have several questions on Polygon mintable assets, based on the templates in this repository:

https://github.com/maticnetwork/pos-portal/blob/master/flat/ChildMintableERC20.sol
https://github.com/maticnetwork/pos-portal/blob/master/flat/DummyMintableERC20.sol

The documentation here does not address these questions.

(1) Should the name (ticker) of the token on the Polygon network be the same as the name of the token on Ethereum mainnet? So if my Ethereum ERC20 token is called XYZ, should the Polygon version be called just XYZ, or should it be called wXYZ?

(2) Why does the ChildMintableERC20.withdraw​ function have no access controls? I realize if a user calls this, it will only lose them tokens, but shouldn't you limit access to calling this function to only a Polygon router? Otherwise maybe a user can burn tokens early, which will make the router fail when trying to move tokens between chains. Who knows, it could trigger some security vulnerability. All router-specific functions should be locked down and limited so that only the router can call them.

(3) Why does the ChildMintableERC20.deposit function take an argument bytes calldata depositData​, which has to be decoded through abi.decode​? Why isn't the parameter decoded before it is passed to this function?

(4) Why does the mint​ function require the role DEFAULT_ADMIN_ROLE​, while deposit​ requires DEPOSITOR_ROLE​? In practice, is it only one router contract that has both roles? Your documentation on mintable assets does not talk about what the DEFAULT_ADMIN_ROLE​ role is, or which router contract should be assigned this role.

(5) Your contract DummyMintableERC20​ has a function mint(address user, uint256 amount)​ which has the same signature as the function of the same name in ChildMintableERC20​. However, the former takes role PREDICATE_ROLE​ and the latter takes role DEFAULT_ADMIN_ROLE​. If I want to deploy the same exact contract to Ethereum mainnet and Polygon, does this mean this function needs to be callable by two different contracts, one for each of the two roles?

@hiroshi-yamamoto-dublr
Copy link
Author

Also, is there any advantage to using the Polygon bridging function, rather than using Multichain to move assets to and from Ethereum mainnet? The functionality seems to be exactly the same.

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

No branches or pull requests

1 participant