Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
elven-tools
Advanced tools
Interacting with custom NFT related Smart Contracts on the Elrond blockchain
🚨 Not enough tests! As for the mainnet, use it at your own risk! 🚨
For now it is designed to deploy the contract: elven-nft-minter-sc.
npm install elven-tools -g
elven-tools --version
or elvent-tools -v
elven-tools --help
or elven-tools -h
- for getting the commands on the root levelelven-tools nft-minter --help
or elven-tools nft-minter -h
- for getting all the commands for the subcommandBe aware that, by default, all will happen on the devnet. See below how to change it.
First steps:
elven-tools derive-pem
- you would need to generate the PEM file for all further operations, do not share it with anyone. It works similar to erdpy wallet derive
. It will take the keyphrase and generate the walletKey.pem
file in the same directory.elven-tools deploy nft-minter
- by default, the tools will take the abi and wasm source code and deploy directly from the main branch of the smart contract. There are two options to work with it, though. You can configure a different branch or tag, or you can download the files and work on them locally.development
create the .elventoolsrc
file in the same directory where the walletKey.pem
file is located, put there { "nftMinter": { "version": "development" } }
. It can be also a tag name of the release in this GitHub repository.walletKey.pem
. It should look like: sc/nft-minter
. Here you will need to put the .wasm and .abi.json files which you can get from the output directory of the Smart Contract.elven-tools nft-minter issue-collection-token
. You will be asked for the name and the ticker. Keep the name without spaces and the ticker short and capitalized.elven-tools nft-minter set-roles
elven-tools nft-minter start-minting
or setup a drop elven-tools nft-minter set-drop
where the minting will be split into 'waves'. The first version of the Smart Contract mints randomly on demand and sends the NFT to the buyer. More advanced logic will land in version 2.walletKey.pem
for that run elven-tools nft-minter mint
.elven-tools nft-minter --help
; below, you'll find all of them with short descriptions.elven-tools derive-pem
- derives the PEM file from seed phrase (keywords)elven-tools deploy nft-minter
- deploys the smart contract (by default from the main branch using the devnet, can be configured)elven-tools nft-minter issue-collection-token
[only owner] - issue main collection handle, it costs 0.05 EGLD, and it is a must in the Elrond chain. All NFTs will be under this collection. The cost here is a one-time payment for the whole collection.elven-tools nft-minter set-roles
[only owner] - for now, the command sets the critical role for the collection handle. It is a 'create nft' role.elven-tools nft-minter start-minting
[only owner] - by default, after deploying the smart contract, the minting is disabled. You would need to start itelven-tools nft-minter pause-minting
[only owner] - you can also pause it at any momentelven-tools nft-minter set-new-price
[only owner] - you can set a new price per NFT for the whole collectionelven-tools nft-minter giveaway
[only owner] - as an owner, you can give some random tokens to other addresses.elven-tools nft-minter set-drop
[only owner] - you can also split the minting into drops. These are 'waves' of minting where you can change prices and promote each one (v1 doesn't include any logic for revealing the CIDs with delay, the revealed NFTs will be sent in every drop).elven-tools nft-minter unset-drop
[only owner] - you can also disable the drop and pause mintingelven-tools nft-minter claim-dev-rewards
[only owner] - as an owner of the Smart Contract, you can always claim the developer rewards. Read more about them in the Elrond docs.elven-tools nft-minter change-base-cids
[only owner] - you can change base IPFS CIDs only before any NFT was minted. Otherwise, it doesn't make sense to do that.elven-tools nft-minter set-new-tokens-limit-per-address
[only owner] - it is possible to change the limits per address which are configured when deploying the Smart Contractelven-tools nft-minter claim-sc-funds
[only owner] - this is treated as a fallback for royalties, there is no way for now to implement other solution, the Smart Contract will receive the royalties as the creator, so there has to be a way to get them back. Generally, it shouldn't be required otherwise. Proper solutions will be with the esdt_nft_create_as_caller
, which doesn't work yet.elven-tools nft-minter shuffle
- as a user, you can take part and ensure that the minting is random. This transaction will reshuffle the next index to mint. Everyone can run it.elven-tools nft-minter mint
- the main mint function, you can mint NFTs using any walletKey.pem
fileelven-tools nft-minter get-total-tokens-left
- the Smart Contract query, returns amount of tokens leftelven-tools nft-minter get-provenance-hash
- the Smart Contract query returns the provenance hash if provided when deployingelven-tools nft-minter get-drop-tokens-left
- the Smart Contract query returns the number of tokens left per dropelven-tools nft-minter get-nft-price
- the Smart Contract query, returns the current priceelven-tools nft-minter get-nft-token-id
- the Smart Contract query, returns the collection token idelven-tools nft-minter get-nft-token-name
- the Smart Contract query, returns the collection token nameelven-tools nft-minter get-tokens-limit-per-address
- the Smart Contract query returns the tokens limit per addresselven-tools nft-minter get-tokens-minted-per-address
- the Smart Contract query returns the number of tokens minted per one addressBelow is an example of a .elventoolsrc
config file with default values. It is not required if you will work on the devnet with the main branch of the Smart Contract. In other cases, you would need to have it. It should be located in the same directory from which the elven-tools
commands are triggered—the same directory as the one where the walletKey.pem
file is located.
{
"chain": "devnet",
"customProxyGateway": "https://devnet-gateway.elrond.com",
"nftMinter": {
"version": "main",
"deployGasLimit": 120000000,
"issueCollectionTokenGasLimit": 80000000,
"issueValue": "0.05",
"assignRolesGasLimit": 80000000,
"issueTokenFnName": "issueToken",
"setLocalRolesFnName": "setLocalRoles",
"mintBaseGasLimit": 11000000,
"tokenSelingPrice": "",
"mintFnName": "mint",
"giveawayBaseGasLimit": 11000000,
"giveawayFnName": "giveaway",
"setDropFnName": "setDrop",
"setUnsetDropGasLimit": 12000000,
"unsetDropFnName": "unsetDrop",
"pauseUnpauseGasLimit": 5000000,
"pauseMintingFnName": "pauseMinting",
"unpauseMintingFnName": "startMinting",
"setNewPriceGasLimit": 5000000,
"setNewPriceFnName": "setNewPrice",
"shuffleFnName": "shuffle",
"shuffleGasLimit": 6000000,
"getTotalTokensLeftFnName": "getTotalTokensLeft",
"getProvenanceHashFnName": "getProvenanceHash",
"getDropTokensLeftFnName": "getDropTokensLeft",
"getNftPriceFnName": "getNftPrice",
"getNftTokenIdFnName": "getNftTokenId",
"getNftTokenNameFnName": "getNftTokenName",
"getMintedPerAddressTotalFnName": "getMintedPerAddressTotal",
"getTokensLimitPerAddressTotalFnName": "getTokensLimitPerAddressTotal",
"getMintedPerAddressPerDropFnName": "getMintedPerAddressPerDrop",
"getTokensLimitPerAddressPerDropFnName": "getTokensLimitPerAddressPerDrop",
"changeBaseCidsFnName": "changeBaseCids",
"changeBaseCidsGasLimit": 5000000,
"setNewTokensLimitPerAddressFnName": "setNewTokensLimitPerAddress",
"setNewTokensLimitPerAddressGasLimit": 5000000,
"claimScFundsFnName": "claimScFunds",
"claimScFundsGasLimit": 6000000,
"populateIndexesBaseGasLimit": 5000000,
"populateIndexesMaxBatchSize": 5000,
"populateIndexesFnName": "populateIndexes"
}
}
Whole config with default values: config.ts
Please post issues and ideas here.
MIT + GPLv3 (Elrond tooling)
1.2.0 (2022-01-31)
getMintedPerAddressTotal
endpoint | command get-minted-per-address-total
,getTokensLimitPerAddressTotal
endpoint | command get-tokens-limit-per-address-total
,getMintedPerAddressPerDrop
endpoint | command get-minted-per-address-per-drop
,getTokensLimitPerAddressPerDrop
endpoint | command get-tokens-limit-per-address-per-drop
populateIndexes
with command populate-indexes
- use only as fallback if something goes wrong with the deployment. The populateIndexes endpoint will be called by default when deploying.FAQs
Interacting with custom NFT/SFT-related smart contracts on the MultiversX blockchain
The npm package elven-tools receives a total of 16 weekly downloads. As such, elven-tools popularity was classified as not popular.
We found that elven-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.