solang
solang copied to clipboard
Make Solang compiled contracts compatible with Anchor
Remaining work (who is working on it in parenthesis)
- [x] Borsh decoding (Lucas)
- [x] Allow function selector to be overriden with new selector, variable length on Solana. (Sean)
- [x] Convert IDL file to solidity interface file
solana metadata --target solana [-o outputfile] foo.idl(Sean) - [x] Use borsh encoding for function arguments calls with overriden selector (provide end to end IDL tests with this) (Sean)
- [x] Use borsh encoding for events (Lucas)
- [x] Use borsh encoding for function return values with overriden selector (Sean)
- [ ] Rewrite contract dispatch code in CFG
- [ ] Use borsh encoding for ALL function calls and returns values (requires all tests to be fixed)
- [ ] Do not pass destination/sender account via input, but via accounts
- [ ] Solang should produce one binary per contract, just like Anchor/Substrate/ewasm (Sean)
- [ ] Produce IDL for Solana contracts
- [ ] Write tests using anchor CLI - anchor itself will need work!
- [ ] Write PDA tests. The seed will have to be passed in manually. Should just work (needs tests)
- [ ]
abi.encode()andabi.decode()should use borsh encoding - [ ] Use borsh encoding for
Insert::AssertFailure - [ ] Update documentation for
try ... catch
It is not on this list, but many instructions utilize ABI encoding and need to be modified. One example is Instr::AssertFailure. Its arguments are ABI encoded in emit. That must change if we migrate to Borsh on Solana.
Note that try .. catch also uses abi encoding/decoding but this functionality does not work on Solana anyway. This needs clearer compiler error messages and documentation.