Skip to content
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

Flesh out Rust README #20

Open
mikedotexe opened this issue Jun 16, 2020 · 1 comment
Open

Flesh out Rust README #20

mikedotexe opened this issue Jun 16, 2020 · 1 comment

Comments

@mikedotexe
Copy link
Contributor

mikedotexe commented Jun 16, 2020

Currently the README in the project root has an empty section for Rust. While the tests are a decent step toward informing a user about usage, there are some aspects of the fungible token that are particularly difficult to grasp without being spelled out. For instance, after initializing the contract and sending X fungible tokens to an account, we receive this error:

Error: GuestPanic [Error]: Smart contract panicked: panicked at 'The required attached deposit is 36500000000000000000000, but the given attached deposit is is 0', src/lib.rs:254:13

This is because we need to make sure that state storage doesn't get exploited. Folks have to pay for the storage it will take, essentially. This ticket is for the DevX team to take a first stab at explaining how to use a fungible token, and then tag and pull in @evgenykuzyakov for review.

I believe there are two approaches to fleshing this out:

  1. Give instructions on how to use near-shell to build, deploy, initialize, and use the fungible token, demonstrating escrow and expected behavior.
  2. Use near-api-js and a simple web interface (like we have with Token Contract AS) where folks can add commands in the developer console of their browser and see the results.

Acceptance Criteria:

  • What is generally written above
  • Use the unit tests in the contracts in order to determine ways in which we can give example scenarios using near shell. For instance, walk the use through how to create and initialize a fungible token, send directly from Alice to Bob. Then have Charlie be an escrow between the two, incrementing allowance, etc. A user should be able to come to the README and run a few near shell commands and try out sending fungible tokens around.
@ryancwalsh
Copy link

I'll follow this issue because I'm curious about fungible tokens and escrow too. I asked about escrow here: https://stackoverflow.com/q/70104458/470749 Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants