Concordium / concordium-rust-smart-contracts

Libraries and tools for writing and testing smart contracts on Concordium
https://docs.rs/concordium-std/latest/concordium_std/
Mozilla Public License 2.0
57 stars 36 forks source link

Feedback/Improvements on the smart-contract-wallet implementation #422

Closed DOBEN closed 3 months ago

DOBEN commented 4 months ago

Task description

kudos to @soerenbf for his great input.

Sub-tasks "Naming improvements to shorten/simplify the terminology"

Sub-tasks "Adding serde feature to simplify parsing the type as JSON value between front end and back end"

limemloh commented 4 months ago

Using transfer instead of internalTransfer makes the CIS-5 standard incompatible with CIS-2, so I would suggest using some other name.

soerenbf commented 4 months ago

Using transfer instead of internalTransfer makes the CIS-5 standard incompatible with CIS-2, so I would suggest using some other name.

Ah, right.. didn't think of that! Good point 👍

If the purpose is that these can be mixed, then maybe the transfer function should be prefixed with something that identifies this as a sc-wallet transfer? Can't figure out the best name just off the top of my head

DOBEN commented 4 months ago

Suggestion: cis5Transfer for the name.

update: After a discussion, we realized that there is no function name overlap between CIS-2 and CIS-5. CIS-5 will use as function names transferCCD /transferCIS2Token.

lassemoldrup commented 4 months ago

It seems that the tests rely on cis2-multi being compiled into ../cis2-multi/concordium-out/module.wasm.v1. Maybe this should be added as a step in a build.rs file when building tests? I don't know how well this plays with cargo-concordium though.

DOBEN commented 4 months ago

It seems that the tests rely on cis2-multi being compiled into ../cis2-multi/concordium-out/module.wasm.v1. Maybe this should be added as a step in a build.rs file when building tests? I don't know how well this plays with cargo-concordium though.

Let's discuss and create a separate issue for it. There are 3 contracts that have tests that depend on other contracts currently:

The 'sponsored-tx-enabled-auction' and 'cis5-smart-contract-wallet' examples need the wasm module cis2-multi for its tests. https://github.com/Concordium/concordium-rust-smart-contracts/blob/main/.github/workflows/linter.yml#L901

The 'smart-contract-upgrade' example has a v1 and v2 contract and the tests in v1 needs the wasm module from v2 for upgrading. https://github.com/Concordium/concordium-rust-smart-contracts/blob/main/.github/workflows/linter.yml#L896