The frontend is using adapted code from Gumball Machine Scrypto example using the Radix dApp Toolkit
The scrypto code is original and the technical documentation is provided in the Technical Documentation
Rust-generated documentation is available after running cargo doc
from the scrypto
directory
- Node >= 12.17.0
- The Betanet wallet & Radix-connector browser extenstion installed. Instructions here
- Scrypto v0.8.0. Instructions to install here and update here
- Enter the scrypto directory in a terminal:
cd scrypto
- Build the code:
scrypto build
- Two important files (
gumball_machine.abi
andgumball_machine.wasm
) will be generated inscrypto/target/wasm32-unknown-unknown/release/
. You will need them for the next step.
- Go to the Betanet Dashboard Website
- Connect the Wallet Via the Connect Button
- Navigate to Deploy Package & choose an account and badge or have one created for you if you don't have one yet using the link below. (Which appears once you have selected an account)
- Upload both
cup_perps.abi
andcup_perps.wasm
- Click on "publish package"
- The wallet should open up and ask you to approve the transaction
- On the wallet click on "sign transaction"
- The deployed package address should get displayed. You will need it for the next step.
- In a terminal go back to the root of this project (dapp-toolkit-gumball-machine)
- Install the npm dependencies:
npm install
- Start the local server with
npm start
- Open up your browser at the provided url if it doesn't open automatically.
- Make sure you created an account on the wallet and added funds via the faucet by clicking on account name and then the three dots a button to get XRD from faucet should open.
- Click on the connect button to fetch your wallet address. You should see your address appearing
- Fill the package address you got in the previous section and enter a symbol name for your gumball to display in the wallet then click on "instantiate gumball machine"
- Your wallet will again open up. Click on "sign transaction". You should now see the instantiated component address and Gumball resource address on the page.
- Buy a gumball by clicking on "10 XRD Long"
- Your wallet will open up. Click on "sign transaction". The transaction receipt will get displayed on the page.
- Check the number of Long LP tokens you have by clicking on the account name in your wallet and viewing the tokens tab.