A simple Cosmwasm Smart Contract for the Terra Blockchain

Job ID: 31176387

Budget: $10 – $25 USD

The main purpose of this Smart Contract will be to create, update, and allow for the retrieval of a list of users wallet addresses.

REQUIREMENTS:
• Uses CosmWasm libraries
• “cosmwasm-std” >= “0.16.0”
• Compiled contract wasm can be stored on the Terra Blockchain

CONDITIONS OF SATISFACTION:
• Contract has an INSTANTIATE endpoint, which takes an empty message
• Should set a “users” STATE property to be an empty vector of Addr items when first instantiated
• Assign an “owner” STATE property to be equal to the wallet address that sent the instantiation transaction
• Contract has the following EXECUTE endpoints:
• AddUser { user: String } → should add the user address to the users list, only if the sender is the Contract “owner” and the String address is vaild
• RemoveUser { user: String } → should remove the user Addr from the 'users' list, only if the sender is the Contract “owner”
• Contract has the following QUERY endpoints:
• Users { } → should return the list of users in STATE, ie. { users: vec<String> }
• User { user: String } → should return true/false for whether or not the passed Addr exists in the list of 'users', ie. { exists: bool }
Related categories: Blockchain Ethereum Solidity Smart Contracts