Giter Club home page Giter Club logo

tfmw-backbywaxpls's Introduction

The backbywaxpls smart contract was commissioned by on a t break & developed by TheLonely for Terraformers, Many Worlds, A.K.A, TFMW, under the terraformers collection on the Wax Blockchain.

The purpose of this smart contract is to allow the autonomous Wax backing of NFTs.

Backbywaxpls works by setting up individual templates that will trigger a notify action when they are minted to be backed the designated amount of WAXP tokens.

Requirements:

  • EOS based smart contract compiler.
  • The wallet that you will deploy this smart contract under will need to be added as a Notify Account your collection.
  • A reserve of WAXP tokens sent to the atomicassets contract from the wallet that has deployed this contract.
  • Around 400kb of RAM to upload the contract, as well as an additional 128 bytes of RAM per template that you wish to be backed
  • Around 25 WAXP of CPU & 5 WAXP of NET in staking

Limitations:

  • This contract handles the autonomous backing of NFTs, however, it does not handle the WAXP tokens that need to be deposited into the atomicassets contract for it to back assets with.
  • Failure to have the required WAXP tokens (as designated by the template on your deployed contract) will result in a failure to mint said asset, until either the template is removed from the contract list or WAXP tokens have been provided.
  • This contract is unable to back assets for collections which do not have the wallet that this contract is deployed under as a Notify Account.

The following instructions have been provided for demonstrative purposes on the testnet.

Step 0: Compile contract. Project settings: root = src/tokenreward.cpp, name = tokenreward.

Step 1: Upload contract https://wax-test.bloks.io/wallet/utilities/upload-contract

Step 2: Add eosio.code permission under the active key of the wallet you are deploying this contract from: https://wax-test.bloks.io/wallet/permissions/advanced

  • You can verify if you have done it correctly by comparing it to our deployment here: https://wax-test.bloks.io/account/backtokencon#keys
  • If you plan to use another smart contract to deposit WAXP tokens into backbywaxpls, you need to also add said contract permissions under the active key, as you will be required to send the WAXP tokens on your deployed version of backbywaxpls to atomicassets.

WARNING:

  • Practice caution when performing any actions that have to do with wallet permissions. You can very well brick a wallet by making a mistake here.
  • Any actions that have to do with changing wallet permissions will trigger a forbidden action warning from Anchor.
  • You will have to temporarily allow them in your settings & then turn them back off.
  • This step is only required to be done once.
  • You are NOT supposed to add our wallet, which is backbywaxpls, under the active permissions.
  • You are supposed to add the wallet that you are deploying the contract from.
  • You are essentially giving your own wallet permission. We, nor anyone else, is receiving any permissions.
  • We are not responsible for any harm that arises from this, nor any other step.

Step 3: Add the wallet that you have deployed backbywaxpls under as a Notify Account under your collection.

Step 4: On your deployed contract, perform the init action.

Step 5: Under the settemplate action, put in the template_id of the asset you would like backed, as well as the amount of WAXP tokens.

  • In the token field, you must provide 8 decimal places, as well as the symbol WAX. I.e. 25.00000000 WAX

Step 6: Under the maintenance action, hit the switch off & submit. While maintenance is on, the assets will not be backed by WAXP tokens, however, assets will still continue to be minted.

And that's all that there is to it.

In the case that you would like an asset that is already minted to be backed by WAXP, as long as the settemplate data is setup, users can perform the claimtokens action to have their asset backed by WAXP at any time.

How to top up the contract's WAXP balance for token backing; minting can fail when there is no balance: First time setup: https://wax-test.bloks.io/account/atomicassets?loadContract=true&tab=Actions&account=atomicassets&scope=atomicassets&limit=100&action=announcedepo call this with contract name and 8,WAX (to setup your atomicassets balances)

https://wax-test.bloks.io/wallet/transfer Sent to: atomicassets Memo: deposit (you can only send WAX)

To withdraw: https://wax-test.bloks.io/account/atomicassets?loadContract=true&tab=Actions&account=atomicassets&scope=atomicassets&limit=100&action=withdraw

Action Info:

  • Action: init, call it once/first time after uploading contract
  • Action: destruct, will remove the config from the contract (eg for config/contract upgrades)
  • Action: maintenance, toggle maintenance on/off, by default maintenance is on. Maintenance = no tokens will be backed, asset minting will be OK
  • Action: settemplate, update or set the config for a template id; use full token precision eg 1.12341234 WAX
  • Action: rmtemplate, remove a template
  • Action: claimtokens, allows users to let the contract back their asset (if allowed) with tokens

Disclaimer:

Socials:

Contacts via Discord:

  • on a t break @ on a t break#6196
  • TheLonely @ TheLonely#4812

tfmw-backbywaxpls's People

Contributors

on-a-t-break avatar

Stargazers

Douglas James Butner avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.