Skip to content

Commit

Permalink
Merge pull request #48 from ElvenTools/giveway-changes
Browse files Browse the repository at this point in the history
giveaway improvements
  • Loading branch information
juliancwirko authored Aug 27, 2022
2 parents bbd0056 + 595d2d1 commit c8a1569
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 29 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### [1.9.0](https://github.com/ElvenTools/elven-nft-minter-sc/releases/tag/v1.9.0) (2022-08-27)
- giveaway changes, now it works with multiple addresses, Elven Tools CLI is adjusted to support entering them by hand or using the input JSON file

### [1.8.0](https://github.com/ElvenTools/elven-nft-minter-sc/releases/tag/v1.8.0) (2022-07-30)
- elrond-wasm framework update to 0.34.1
- added `#[only_user_account]` for some of the endpoints, we want to allow only user interactions there
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "elven-nft-minter"
version = "1.8.0"
version = "1.9.0"
authors = ["Julian Ćwirko <julian.io>"]
edition = "2018"
publish = false
Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,25 @@

Be aware that the Smart Contract doesn't have any audits. It has complete functionality for the first version, but it still needs some improvements. Test it first on the devnet/testnet.

**You can use [elven-tools-cli](https://github.com/ElvenTools/elven-tools-cli) for deployment and interactions!**
**You can use [elven-tools-cli](https://github.com/ElvenTools/elven-tools-cli) for deployment, setup and interactions!**

**You can use [elven-tools-dapp](https://github.com/ElvenTools/elven-tools-dapp) as your frontend dapp for minting process! (NextJS based app)**

### Tracking the progress

- [Elven Tools Smart Contract kanban](https://github.com/orgs/ElvenTools/projects/4)
**You can use [elven-tools-dapp](https://github.com/ElvenTools/elven-tools-dapp) as your frontend dapp for minting process! (NextJS based app with 4 auth providers)**

### What is it?

You are reading about the Smart Contract designed for the Elrond blockchain. Its primary purpose is to provide a simple logic for minting and buying a previously configured collection of NFTs. It does it in a randomized way. Version 1 of it supports:

- issuing the collection token
- setting the create role
- setting the proper roles
- pausing/unpausing the process
- random mint and distribution
- minting multiple NFTs in one transaction
- giveaway options
- possibility to split the process into drops/waves/batches, here it is called 'drop'
- configuring the allowlist
- giveaway options + multiple addresses distribution in one transaction
- possibility to split the process into drops (waves/batches). It is named 'drop'
- configuring the allowlist, populate from a file or provide by hand
- claiming the developer rewards
- changing basic setup where it is possible
- and more...

Start here: [Elven Tools Jumpstart](https://www.elven.tools/docs/jump-start.html)

Expand All @@ -46,9 +43,11 @@ For all commands, check out the docs: [www.elven.tools/docs/sc-endpoints.html](h

### Other ways of using it

You can always clone it and change it as you need. The best is to use the Elven Tools CLI tool, which can also be configured after changes. But nothing stops you from using the [erdpy](https://docs.elrond.com/sdk-and-tools/erdpy/erdpy/) and interacting with this Smart Contract. It is all up to you.
You can always clone it and change it as you need. The best is to use the Elven Tools CLI tool, which can also be configured after changes. But nothing stops you from using the [erdpy](https://docs.elrond.com/sdk-and-tools/erdpy/erdpy/). It is all up to you. Of course you will need to do more work when using the erdpy.

**Rust devs, I would appreciate it if you could leave your insights ❤️**
### Tracking the progress

- [Elven Tools Smart Contract kanban](https://github.com/orgs/ElvenTools/projects/4)

### Contact

Expand All @@ -57,8 +56,10 @@ You can always clone it and change it as you need. The best is to use the Elven

### You may also like

- [elven.js](https://github.com/juliancwirko/elven.js) - simplified wrapper over erdjs, designed to work as a plug-n-play solution for browser based use cases. No build steps and frameworks, just one file to rule it all! Check usage examples!
- [NFT Art Maker](https://github.com/juliancwirko/nft-art-maker) - generates images and metadata files and packs them into CAR files, all from provided PNG layers.
- [Buildo Begins](https://github.com/ElrondDevGuild/buildo-begins) - CLI toolset for interacting with the Elrond blockchain, APIs and smart contracts
- [Export collection owners to CSV](https://github.com/ElvenTools/elven-tools-collection-owners-csv)

### Issues and ideas

Expand Down
4 changes: 2 additions & 2 deletions meta/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion meta/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "elven-nft-minter-meta"
version = "1.8.0"
version = "1.9.0"
authors = ["Julian Ćwirko <julian.io>"]
edition = "2018"
publish = false
Expand Down
10 changes: 5 additions & 5 deletions output/elven-nft-minter.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"contractCrate": {
"name": "elven-nft-minter",
"version": "1.8.0",
"git_version": "a12480f-modified"
"version": "1.9.0",
"git_version": "76512cc-modified"
},
"framework": {
"name": "elrond-wasm",
Expand Down Expand Up @@ -183,11 +183,11 @@
"mutability": "mutable",
"inputs": [
{
"name": "address",
"type": "Address"
"name": "addresses",
"type": "List<Address>"
},
{
"name": "amount_of_tokens",
"name": "amount_of_tokens_per_address",
"type": "u32"
}
],
Expand Down
Binary file modified output/elven-nft-minter.wasm
Binary file not shown.
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ pub trait ElvenTools {
// As an owner of the smart contract, you can send randomly minted NFTs to chosen addresses.
#[only_owner]
#[endpoint(giveaway)]
fn giveaway(&self, address: ManagedAddress, amount_of_tokens: u32) {
fn giveaway(&self, addresses: ManagedVec<ManagedAddress>, amount_of_tokens_per_address: u32) {
require!(!self.nft_token_id().is_empty(), "Token not issued!");

let token = self.nft_token_id().get();
Expand All @@ -232,12 +232,14 @@ pub trait ElvenTools {
);

require!(
self.get_current_left_tokens_amount() >= amount_of_tokens,
self.get_current_left_tokens_amount() >= amount_of_tokens_per_address * addresses.len() as u32,
"All tokens have been minted already or the amount you want to mint is too much. Check limits! (totally or per drop)!"
);

for _ in 0..amount_of_tokens {
self.mint_single_nft(BigUint::zero(), OptionalValue::Some(address.clone()));
for address in addresses.into_iter() {
for _ in 0..amount_of_tokens_per_address {
self.mint_single_nft(BigUint::zero(), OptionalValue::Some(address.clone()));
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "elven-nft-minter-wasm"
version = "1.8.0"
version = "1.9.0"
authors = ["Julian Ćwirko <julian.io>"]
edition = "2018"
publish = false
Expand Down

0 comments on commit c8a1569

Please sign in to comment.