Skip to content

Commit

Permalink
fix: Post condition mode is updated to Any
Browse files Browse the repository at this point in the history
  • Loading branch information
Raja Ilayaperumal authored and Raja Ilayaperumal committed Nov 10, 2024
1 parent 79e0ae5 commit 8accb9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions services/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export async function deployContract(pollObject, contractName, callbackFunction)

// this post-condition ensures that our recipient receives at least 5000 STX tokens
const myPostCondition = makeStandardSTXPostCondition(
Constants.STACKS_MAINNET_FLAG ? Constants.MAINNET_DONATION_ADDRESS : Constants.TESTNET_DONATION_ADDRESS, // address of recipient
FungibleConditionCode.GreaterEqual, // comparator
5000000 // relative amount to previous balance (denoted in micro-STX)
Constants.STACKS_MAINNET_FLAG ? Constants.MAINNET_DONATION_ADDRESS : Constants.TESTNET_DONATION_ADDRESS,
FungibleConditionCode.Equal,
5000000 // 1STX = 1000000 micro-STX (denoted in micro-STX)
);

// Transaction options
Expand All @@ -30,7 +30,7 @@ export async function deployContract(pollObject, contractName, callbackFunction)
icon: window.location.origin + "/images/logo/ballot.png"
},

postConditionMode: PostConditionMode.Deny, // whether the tx should fail when unexpected assets are transferred
postConditionMode: PostConditionMode.Allow, // whether the tx should fail when unexpected assets are transferred
postConditions: [myPostCondition], // for an example using post-conditions, see next example

onFinish: callbackFunction,
Expand Down

0 comments on commit 8accb9d

Please sign in to comment.