I want when a user buys an nft, 90% of the amount goes to the author and 10% to the marketplace.
When I deploy my smart contract everything works fine: https://legacy.smartpy.io/ide?cid=QmWDHLWSQYKJSRPbvLWqPc41BZtJ8X7svQgEDnrtckQiHt&k=d5825d30041e66cfc3a4
When I call the smart contract function in react js:
export const collectNFT = ({ Tezos, amount, id, author }) => {
return async (dispatch) => {
try {
const contract = await Tezos.wallet.at(config.contractAddress);
const op = await contract.methods
.collect(id)
.send({ mutez: true, amount: amount });
await op.confirmation();
dispatch(fetchData());
} catch (e) {
console.log(e);
}
};
};
I get an error when confirming on my wallet:
{
"error": [
{
"errors": [
{
"kind": "temporary",
"id": "proto.016-PtMumbai.michelson_v1.runtime_error",
"contract_handle": "KT1JB3JUsvwxrHc6W93ZpWwkKSD3xQGy7waL",
"contract_code": "Deprecated"
},
{
"kind": "temporary",
"id": "proto.016-PtMumbai.michelson_v1.script_rejected",
"location": 152,
"with": {
"int": "83"
}
}
],
"errorDetails": "Error occurred during estimation",
"name": "TezosOperationError",
"id": "proto.016-PtMumbai.michelson_v1.script_rejected",
"kind": "temporary",
"message": "83",
"isError": true
},
{
"errors": [
{
"kind": "temporary",
"id": "proto.016-PtMumbai.michelson_v1.runtime_error",
"contract_handle": "KT1JB3JUsvwxrHc6W93ZpWwkKSD3xQGy7waL",
"contract_code": "Deprecated"
},
{
"kind": "temporary",
"id": "proto.016-PtMumbai.michelson_v1.script_rejected",
"location": 152,
"with": {
"int": "83"
}
}
],
"errorDetails": "Error occurred during estimation",
"name": "TezosOperationError",
"id": "proto.016-PtMumbai.michelson_v1.script_rejected",
"kind": "temporary",
"message": "83",
"isError": true
}
]
}
I would like to know where my error comes from and why. Thank you!