You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the NTCALL, NTCALLVALUE, and NTDELEGATECALL opcodes to take a variable number of token IDs and token amounts instead of a single ETH amount.
Refactor the existing CALL, CALLCODE, CALLVALUE, and DELEGATECALL opcodes to act as "stand-ins" to the new opcodes. Each existing opcode would fall back to its newer counterpart by passing a pair of (BASE_TOKEN_ID,value).
Spec
The proposed spec for NTCALL (analogous logic applies to the other opcodes) expects the token IDs and values to be put on the stack:
Delete the value input at position 3 (alternatively, turn this value into a no-op; more research required)
Add a new value called tokensLength, which signifies the number of token transfers
If tokensLength == 0, do nothing; this call does not transfer any tokens
Add tokensLength pairs of (token_id,value) pairs
Notes
Since the stack can support only up to 1024 elements, a limited number of tokens can be transferred (but this should be high enough for all practical use cases)
In practice, we should set the upper limit for tokensLength to something like 512 to make it difficult for the callee to run afoul of the stack limit
Tasks
NTCALL,NTCALLVALUE, andNTDELEGATECALLopcodes to take a variable number of token IDs and token amounts instead of a single ETH amount.CALL,CALLCODE,CALLVALUE, andDELEGATECALLopcodes to act as "stand-ins" to the new opcodes. Each existing opcode would fall back to its newer counterpart by passing a pair of(BASE_TOKEN_ID,value).Spec
The proposed spec for
NTCALL(analogous logic applies to the other opcodes) expects the token IDs and values to be put on the stack:valueinput at position 3(alternatively, turn this value into a no-op; more research required)tokensLength, which signifies the number of token transferstokensLength == 0, do nothing; this call does not transfer any tokenstokensLengthpairs of(token_id,value)pairsNotes
tokensLengthto something like 512 to make it difficult for the callee to run afoul of the stack limitReferences
CALLopcodes to support MNTs #22