eluv-io / elv-live-js

Eluvio Live JavaScript SDK
MIT License
4 stars 3 forks source link

extend minter cmd #94

Closed elv-preethi closed 1 year ago

elv-preethi commented 1 year ago

It uses MinterRole abi for handling minter operations. cmd. nft_add_minter replaced with nft_or_token_add_minter

1. To create elv-token:

./elv-live token_contract_create <cap> <name> <symbol> <decimals> [options]
./elv-live token_contract_create 1000 tst2 t2 3

Deploy ElvToken contract
ElvToken contract address: 0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178
contract_address: '0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178'
name: tst2
symbol: t2
decimals: '3'

2. To add minter:

 ./elv-live token_add_minter <addr> <minter>
 ./elv-live token_add_minter 0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178 0x39c274147c9f46cca656c7067608df146593bde4

Network: test
Add minter, contract_addr=0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178, minter_addr=0x39c274147c9f46cca656c7067608df146593bde4
Check minter, contract_addr=0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178, minter_addr=0x39c274147c9f46cca656c7067608df146593bde4
is_minter: true

throws error if the minter is not added.

3. To renounce minter:

command needs to be called by a minter.

./elv-live  token_renounce_minter <addr>
 ./elv-live token_renounce_minter 0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178                                           
Network: test
Renounce minter, contract_addr=0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178, user_addr=0x39c274147c9f46cca656c7067608df146593bde4
Check minter, contract_addr=0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178, minter_addr=0x39c274147c9f46cca656c7067608df146593bde4
is_minter: false

throws error if minter is not removed.

4. To check if minter:

./elv-live token_is_minter <addr> <minter>
./elv-live token_is_minter 0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178 0x39c274147c9f46cca656c7067608df146593bde4

Network: test
Check minter, contract_addr=0x7b0b68866f13cbe9ea614c61fedcc6e14d0c7178, minter_addr=0x39c274147c9f46cca656c7067608df146593bde4
is_minter: false
elv-preethi commented 1 year ago

@elv-preethi I would call the commands "token_add_minter" "token_renounce_minter"

We can use the term token for both the erc20 and erc721 kinds in this case

And to create a 'fungible token' (erc20) we can say token_contract_create (we used the word contract here to be very explicit that this is creating a contract)

makes sense will change it.