I’m building a smart asset script to make 1 token = 10 wave, and have a minimum buy of 5 tokens.
The below work fine when within their own seperate script. However, when I combine them as I do below, I get contract error scripts. Is this a bug in my code, or waves itself?
let expiration = 1552064400000 # March 8 2019, 8pm Moscow time
let price = 1000000000 # 10 WAVES
let amount = 5
match tx {
case a: ExchangeTransaction =>
let pair = a.buyOrder.assetPair
let tradedForWaves = ! isDefined(pair.amountAsset) ||
! isDefined(pair.priceAsset)
tradedForWaves && a.price == price
case b: ExchangeTransaction =>
b.amount == amount
case c: BurnTransaction =>
c.timestamp > expiration
case _: TransferTransaction | MassTransferTransaction => true
case _ => false
}