How to limit the amount of asset that someone can have in 1 wallet?

86 views Asked by At

I'm trying to create a smart asset that limits every amount of assets a portfolio can have, suppose I created Age Coin (fictitious and unofficial name) and want every portfolio to have only 100 assets. The goal is to disrupt large speculators who manipulate the market.

1

There are 1 answers

1
KardanovIR On

You can easily check asset balance and deny transactions if current amount + incoming amount > 100

Full asset script can look like below:

{-# STDLIB_VERSION 2 #-}
{-# CONTENT_TYPE EXPRESSION #-}
{-# SCRIPT_TYPE ASSET #-}


match (tx) {
    case t:TransferTransaction => {
        let currentBalance = assetBalance(t.recipient, t.assetId)
        currentBalance + t.amount <= 100
    }
    case _ => false
}