Martian Wallet
June 29, 2023
Question
- Is it possible that moveCall could be reordering parameters prior to a function call?
As seen on suiscan, the error we recieve is from taking a value from_bytes in the dependency functions, which is most likely the recipient - my thought is that due to this reordering of params this could be causing the error.
Discussion
- When building against the framework which is part of the protocol, validator SW update can cause the framework to be updated. The version being compiled should match the version that is on-chain. This is done for all packages but happens the most often for the framework which changes in-place. Should update dependency to match what is onchain. Can fix this by getting rid of framework/ in the revision. framework/testnet tracks the version of the SW currently used, which may not be updated until the epoch change happens.
- Get all coin type, sort them, merge them if needed. Then get the fee in SUIs. The Move Call error has arguments that are ordered. The order does not seem to be preserved. Inputs to the PTB and parameters to the function are distinct. A Moved based test that stubs out everything else but create only a call to the third party contract. Is it an array of this content or a string of bytes — difficult to determine the appropriate type. May be a serialization error / type error.
Noted Areas of Improvement
- Automate testnet protocol bump
- Tooling to check typescript SDK types / serialization best practice: should detect passing non-BCS objects to tx.pure?
- Could also add an easier API?
- Could add semantic types?
- Might need to be documented [tx.pure(…, address)]
- Tooling to lint gas prices (calling setGasPrice when not appropriate)
- Lack of example code in the programmable transaction (PTBs) space, including errors