-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: native tokens #155
feat: native tokens #155
Conversation
7674580
to
1dc47d1
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
1dc47d1
to
77e2a5e
Compare
Co-authored-by: Iaroslav Mazur <[email protected]>
77e2a5e
to
5a7168f
Compare
Either way is fine, as long as on the opposite side (i.e. when the opcode arguments are being input), the items are being pushed in the reverse order. Stack is LIFO-based. Note that in the Therefore, either the address must be popped first in |
Yeah, either way works technically, but this is a matter of consistency and logical flow. The balances (in the state) are mapped from token IDs to amounts, so it makes sense to have the opcode and the precompile follow the same order.
Yes. Happy to pop the address first, because that's an internal operation that end users need not about. |
1e6f66a
to
13ae569
Compare
After having taken a closer look at the other EVM opcodes and how they're implemented in The above would mean:
If you agree, I can include this change with the rest of the things I've got to move on top on this PR branch. |
sounds good |
29e3896
to
927a6df
Compare
feat: EOAs not allowed as Precompile callers fix: argument push order for BALANCEOF; test: mntcallvalues via Precompile; test: fix the caller's Nonce; refactor: extract the byte-parsing tools to primitives/utilities.
927a6df
to
eb07a64
Compare
3e25ca0
to
47d4a03
Compare
4046cd7
to
3ce3a78
Compare
c7006fd
to
d2c7760
Compare
fix: Precompile now returns Transferred Tokens from Call and not Tx test: get Call Values as a contract refactor: remove the now-redundant EOA-to-Precompile test refactor: use a more suggestive naming in the SabVM tests
d2c7760
to
ea9353c
Compare
e99df44
to
4f0cd8a
Compare
323a89f
to
0ac66cc
Compare
0ac66cc
to
e3c55b4
Compare
2ff2c3c
to
0080f4a
Compare
refactor: Balances -> TokenBalances
test: add some extra verifications in the tests refactor: make the naming inside the tests more suggestive
refactor: extract the Precompile functionalities into stand-alone functions
c67f086
to
50632b3
Compare
docs: document the codebase
@PaulRBerg, the PR is ready to be reviewed |
As discussed privately, I'm integrating this PR without @PaulRBerg's review. |
Context
A big PR that closes #5, #74 and #145.
This PR is a replacement for #14 and #148, which we have closed as a result of (i) multiple conflicts due to an in-flight merge and (ii) the name change from MNAs to MNTs.
Feedback
I slogged through the rebase, reviewing your work @IaroslavMazur in the process.
Feedback and changelog:
drain_balances
because this function is needed only for the DAO hardforkincrease_base_balance_saturating
instead ofset_base_balance(get_base_balance().saturating_add())
BALANCEOF
; as mentioned in the spec, the token id comes firstNTCALL
,NTDELEGATECALL
, andNTCREATE
implementations because we're not planning on supporting smart contracts in Genesis (besides MNTs themselves).NTCALLCODE
opcode, just anNTDELEGATECALL
becauseCALLCODE
is a deprecated version ofDELEGATECALL
.Rebasing
I will create a separate discussion about our REVM rebasing strategy.