Closed sxurik closed 3 years ago
Claiming several tokens like this:
await Promise.all([ bob.contract.claim_token({ gate_id: someGateId }), bob.contract.claim_token({ gate_id: someGateId }), ]);
should mint 2 tokens.
But for some reason only one token gets minted and added, all calls to claim_token return the same token_id. The same happens when making for example 5 calls instead of 2 - only 1 token is minted.
claim_token
token_id
Making 4 calls from 2 different accounts:
await Promise.all([ bob.contract.claim_token({ gate_id: someGateId }), alice.contract.claim_token({ gate_id: someGateId }), bob.contract.claim_token({ gate_id: someGateId }), alice.contract.claim_token({ gate_id: someGateId }), ]);
results in 2 tokens being created instead of 4.
But if there were some method-calls on the contract recently, claim_token from this contract works correctly.
So this code:
await alice.contract.create_collectible({ ... }); await Promise.all([ bob.contract.claim_token({ gate_id: someGateId }), alice.contract.claim_token({ gate_id: someGateId }), bob.contract.claim_token({ gate_id: someGateId }), alice.contract.claim_token({ gate_id: someGateId }), ]);
mints 2 tokens for alice (which is expected) and 1 token for bob (instead of 2).
alice
bob
However, this results in 2 tokens claimed:
await Promise.all([ bob.contract.claim_token({ gate_id: someGateId }) ]); await Promise.all([ bob.contract.claim_token({ gate_id: someGateId }) ]);
Claiming several tokens like this:
should mint 2 tokens.
But for some reason only one token gets minted and added, all calls to
claim_token
return the sametoken_id
. The same happens when making for example 5 calls instead of 2 - only 1 token is minted.Making 4 calls from 2 different accounts:
results in 2 tokens being created instead of 4.
But if there were some method-calls on the contract recently,
claim_token
from this contract works correctly.So this code:
mints 2 tokens for
alice
(which is expected) and 1 token forbob
(instead of 2).