Skip to content

Commit

Permalink
maxMintAmount -> limit
Browse files Browse the repository at this point in the history
  • Loading branch information
msinkec committed Jan 13, 2024
1 parent 6e68836 commit dc8cf8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/contracts/bsv20MintBasic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ export class BSV20Mint extends BSV20V2 {
supply: bigint

@prop()
maxMintAmount: bigint
limit: bigint

constructor(
id: ByteString,
sym: ByteString,
max: bigint,
dec: bigint,
supply: bigint,
maxMintAmount: bigint
limit: bigint
) {
super(id, sym, max, dec)
this.init(...arguments)

this.supply = supply
this.maxMintAmount = maxMintAmount
this.limit = limit
}

@method()
public mint(dest: Addr, amount: bigint) {
// Check mint amount doesn't exceed maximum.
assert(amount <= this.maxMintAmount, 'mint amount exceeds maximum')
assert(amount <= this.limit, 'mint amount exceeds limit')

let outputs = toByteString('')
let transferAmt = amount
Expand Down
10 changes: 5 additions & 5 deletions src/contracts/bsv20MintTimeLock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class BSV20MintTimeLock extends BSV20V2 {
supply: bigint

@prop()
maxMintAmount: bigint
limit: bigint

@prop(true)
lastUpdate: bigint
Expand All @@ -28,15 +28,15 @@ export class BSV20MintTimeLock extends BSV20V2 {
max: bigint,
dec: bigint,
supply: bigint,
maxMintAmount: bigint,
limit: bigint,
lastUpdate: bigint,
timeDelta: bigint
) {
super(id, sym, max, dec)
this.init(...arguments)

this.supply = supply
this.maxMintAmount = maxMintAmount
this.limit = limit
this.lastUpdate = lastUpdate
this.timeDelta = timeDelta
}
Expand All @@ -52,8 +52,8 @@ export class BSV20MintTimeLock extends BSV20V2 {
// Update last mint timestamp.
this.lastUpdate = this.ctx.locktime

// Check mint amount doesn't exceed maximum.
assert(amount <= this.maxMintAmount, 'mint amount exceeds maximum')
// Check mint amount doesn't exceed limit.
assert(amount <= this.limit, 'mint amount exceeds limit')

let outputs = toByteString('')
let transferAmt = amount
Expand Down

0 comments on commit dc8cf8b

Please sign in to comment.