Closed friedger closed 4 years ago
In the hodl token contract (https://github.com/friedger/clarity-smart-contracts/blob/master/contracts/tokens/hodl-token.clar) two assets are transferred in one hodl transaction.
hodl
There are two post conditions defined in a makeContractCall:
makeContractCall
postConditions: [ makeStandardFungiblePostCondition( contractAddress, FungibleConditionCode.Equal, new BigNum(0), new AssetInfo(contractAddress, "hodl-token", "hodl-token") ), makeStandardFungiblePostCondition( contractAddress, FungibleConditionCode.Equal, new BigNum(5), new AssetInfo(contractAddress, "hodl-token", "spendable-token") ), ],
The testnet complains about a missing post condition for hodl-token asset:
hodl-token
Post-condition check failure: No checks for fungible token type AssetIdentifier { contract_identifier: QualifiedContractIdentifier { issuer: StandardPrincipalData(26, [210, 137, 135, 159, 210, 247, 227, 61, 194, 243, 163, 67, 70, 194, 6, 243, 93, 231, 54, 150]), name: ContractName("hodl-token") }, asset_name: ClarityName("hodl-token") } moved by Standard(StandardPrincipalData(26, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]))
If I remove one post condition, the testnet complains about the other missing asset condition. It looks like one one condition is recognized.
To test:
yarn test
I understand that I have used the wrong address for hold-token, the sender is the bank-account
hold-token
bank-account
In the hodl token contract (https://github.com/friedger/clarity-smart-contracts/blob/master/contracts/tokens/hodl-token.clar) two assets are transferred in one
hodl
transaction.There are two post conditions defined in a
makeContractCall
:The testnet complains about a missing post condition for
hodl-token
asset:If I remove one post condition, the testnet complains about the other missing asset condition. It looks like one one condition is recognized.
To test:
yarn test