Here is a high -quality state about the problem you are stalked with metamask and web3.js on binance smart chain (BSC):
Oshybka: Unreflender Uchol Write in web3.js on Binance Smart Chain (BSC)
As a policeman of the Decontralyzed Prilates (Dapps), Built on the fresh of the intellectual Tepi Binance (BSC), You, Believert, Stacked with the scorching in the middle of the way. In this state, we will ulce in the problem, with which you are table, and the implementation for it.
Problem: Returned scoring “Unknown Up”
When you make the method of calling on the subdrazhka metamask with the web3.js on BSC, Behind the BCA is usually “unwavering” this is indicationed by the fact that the transaction is not successful or unauthorized.
Ponimania Directions of the Ucholuty in Metamask
In Metamask, The Records are Managed as Partial Keys. Each Cottage Records Have A Unique Pair of Key (Public and Partial), which is Hurled on Your Hostel. When you are provoking a quotation, it appointed a publient address. However, when you set aside the transaction into the counteract with the metamask, the ugly recording is not obligatory of the same, with which you made.
Why what no -will complete structures
There are Several Ones, on which you can resist this score:
- Different stitches : When you are the calling of the method with the use. This is connected with the fact that there is a closed key, which is used to sign the transaction.
- No do not touch on the seat : Some counterattacks can not be thrown in the seat in their Institution code. This indicates that if you call the “mint” technode with an non -prevailing record, it can be called repeatedly once in the second accounts (even if they are used by different keys), which blows.
Resurrection Oshibki Unknown Cattle
To Solve This Problem, Follow this Step:
- Check your cuts : Encourage that your points metamask are right -in -minded and tie with your culprit record of BSC.
- using a single staff for all transaction : When it is Possible, Use One and the Same Quantity (Generally Available Address) for All Transaction. This is guaranteed that you are always setting off with a right -wing recording.
3.
4.
Primer code
Here’s the primer that you can change your code to spread the invisible recording:
`JavaScript
Contract = New Web3.eth. contract ('...');
contract.hods.min (account, cid) .send ({from: account})
.Then ((result) => {
Console.log (result); // mint successful!
})
.catch ((liner) => {
If (error.code === 'invalid account') {
Console.error ('Unknown Undical Record, Used for Transaction:', Swing);
} Still {
Brating the scoop;
}
});
The follow -up of this step and intended to do it for all transaction, you are able to spread the scraper “inside the settlement”.