-
Notifications
You must be signed in to change notification settings - Fork 38
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
BREAKING CHANGE: change ckb decimal to 18 #675
BREAKING CHANGE: change ckb decimal to 18 #675
Conversation
8b67bda
to
9597b6d
Compare
9597b6d
to
8950ef4
Compare
99412c8
to
afc4c7a
Compare
a9ece23
to
08f3fab
Compare
We should also change |
4ab866c
to
8d32a46
Compare
72dd582
to
fb6a073
Compare
CHANGELOG.md
Outdated
@@ -19,6 +19,8 @@ In the new version, we improve the compatibility of Godwoken: | |||
- Support Ethereum signature format and EIP-712. User can view the transaction before signing, instead of signing a random 32 bytes message. [#561](https://github.com/nervosnetwork/godwoken/pull/561) | |||
- Fix the total supply interface of sUDT ERC-20 proxy contract [#560](https://github.com/nervosnetwork/godwoken/pull/560) | |||
- Support interactive with eth address that haven't been registered to Godwoken. | |||
- Unify layer 2 fungible token represatation as uint256. | |||
- Change layer 2 ckb decimal from 8 to 18, improve compatibility between metamask and native ckb. [#675](https://github.com/nervosnetwork/godwoken/pull/675) | |||
|
|||
In short, as a developer, you can use Godwoken v1 just like anyother Ethereum compatible chain, all you need to do is to switch the network to Godwoken. The polyjuice-provider web3 plugin is removed in the v1 version. |
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.
In short, developers can use Godwoken v1 the same way as other ethereum compatible chains, all that has to be done is to switch the network to Godwoken. The polyjuice-provider web3 plugin has been removed in v1.
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.
Yes
Why: godwokenrises/godwoken#675 change the precision of units. How: Adjust the molecule types New types definition: https://github.com/zeroqn/godwoken/blob/e5add779d0f5a5b460e3154859880fab8906f21f/crates/types/schemas/godwoken.mol ``` moleculec --language - --schema-file godwoken.mol --format json moleculec-es -inputFile 1.json -outputFile generated.js -generateTypeScriptDefinition ./node_modules/.bin/babel --plugins @babel/plugin-transform-modules-commonjs src/schema/generated.js ``` Tags:
godwoken - godwokenrises/godwoken#675 godwoken-scripts - godwokenrises/godwoken-scripts#118 godowken-polyjuice - godwokenrises/godwoken-polyjuice#146 godowken-tests - godwokenrises/godwoken-tests#105
Purpose
This PR unified layer2 fungible token representation as u256.
This PR also changes the decimal of CKB, in layer1 CKB is represented in 8 decimal, but when user deposit CKB into layer2, we changed the representation to 18 decimal. Thus, layer2 CKB can play the same role as ETH, developers can operate CKB as 18 decimal asset(like ETH) in their contract without modification. This change also improve the compatibility between Metamask and the native token CKB.