Please tell me about smart asset

153 views Asked by At

This is an example of the Waves IDE.

Please let me know how to transfer this smart asset token. m(__)m

match tx {case tx : TransferTransaction =>
let issuer = Address(base58'3MsZgp7XvTJV7TuqaZ46RJZuG2CtvcxYgC9')
isDefined(getInteger(issuer, toBase58String(tx.id)))
case m :SetAssetScriptTransaction | SetScriptTransaction =>true
case _ => false
}

I am the issuer. Do I add something to this Json and POST?

Share the Link to Sign↓

{
"version": 2,
"assetId": "GMpv7cLThamxe7sHh5n52zZFKcHqPU4GAmxGXTxwRA2A",
"amount": 100000,
"feeAssetId": "",
"fee": 500000,
"recipient": "3Muet8GgfyC6Xd1Qv7TNjqT2N4dUwmJPfXC",
"attachment": "",
"timestamp": 1554080004122,
"senderPublicKey": "9QYYVjZntWane75e8ZyoacJdtrfUhuCTSYctVTqxTnJM",
"proofs": ["SoFHDJY6SMUyY8a4t2ZiEFgdc8DRUCcBUNcqrPjfbjgvq7bg74TJKdBw8UHDunKpg9GhjSw7QRXh4VMhuNcPdjm"],
"type": 4
}

thank you for reading.

1

There are 1 answers

0
Nazim Faour On
  1. you issue an asset with this script(7th line should contain issuer's your address).
  2. you create transferTx but not broadcast it
  3. you get id of this transaction and send a dataTx from issuer's address: data: [{key: , value: 100}]
  4. now you're allowed to send the tx that you've generated earlier and you can broadcast it now

    {-# STDLIB_VERSION 3 #-}
    {-# CONTENT_TYPE EXPRESSION #-}
    {-# SCRIPTTYPE ASSET #-}
    
    match tx {
        case tx : TransferTransaction =>
            let issuer = Address(base58'3MsZgp7XvTJV7TuqaZ46RJZuG2CtvcxYgC9')
            isDefined(getInteger(issuer, toBase58String(tx.id)))
        case m : SetAssetScriptTransaction =>true
        case  => false
    }
    

from here you should issue the token: enter image description here

after you click on issue token, you need to define 3 variables: "name": "your token name", "quantity":1000000, "description": "for testing", after that follow the steps above. example of transfer tx:

const tx = transfer({amount: 10, recipient: "recipient address"})

example of Datatx:

const DataTx = data({data: [{key: "transfer transaction id", value: 100}]})
broadcast(tx)

to find the transfer transaction ID, you just need to type it's name in the console(for example tx)