Title: Resolution of the Swing “Erc721: Calm Calling the Excuse” with Metamask: Erc721 Open Zeppelin (Buy NFT)
Editing:
Good to seek! I am glad to help you solve the problem, with which the many web3 distiller are paid, which is the same as a multi -angle blockchain. In this state, we dissatisfied, why do you go “Erc721: Address to the Allow” Pravlates the Demand Buy NFT with Your Koviel Metamask in the Polyg Set.
Ponimania Problems:
The “ERC721: Combining to Calling Allow” is a prototype in Web3, which can be released by several factor. In this case, it is connected with the one, as the Openzepelin Erc721 counterattack, when the NFT with Metamask is being used to buy. In part, the question appears from that, as the contract is disbursed by the lifetime of the Vladelts tokens.
ERC721 and SUPPOSE:
When you unfold the ERC721 counter on the blockchain platform, such as Polygon, he inherit some of the enormous functions, allowing the policiers to scoop up and sell NFT with the use of his adhesions. The topic does not, this function is swollen on the points of the Metamask polish for conducting transaction for concreted tokens, before the one can be overwhelmed.
Problem C Metamask:
When you ask the function of Buy (_TOKENID) B. However, when you ask you to buy NFT with your Koviel Metamask, he is not a terpit, because the functioning
Custriveis caught without some -liner.
Resolution:
To solve this problem and successfully use the functionBuy (_TOKENID)on your counterattte erc721 with Metamask, downstream:
1.
- Install Metamask : Recognize that you have tuned and plugged the Metamask's koshalek to the blockchain network, on which you are tilted (for example).
- DO NOT LESS, PLACE SUBMISSION TO RIGHT (_EHOTER)
Here's the exquisite version of your code:
Javascript
Const {ethers} = Require ('Web3');
// predatory that you have made new counteract erc721 with the web3.js
Async Function Buynft (_Tokenid, _WNER, _amount) {
ask {
// Calve the Openzepelin Erc721 Counter
Const ERC721 = Wait Ethers.getContractory ('Openzepelinerc721');
// Expire and initiate contract
constanstance = wait ecr721.deploy ();
Want to Tokininstance.Deployed ();
// Release the "Buy" function in counterattte
Const result = Judat tokininstance.buy (_TOkenid, _WNER, _amount);
Result of the Vozurat;
} Catch (error) {
Console.error ('NT:', Error);
Brating the scoop; // Submit the scrapes to strate his signs
}
}
// Primmer Using:
const polygonaddress = ' // Out on the address of polygon blockchain
Const Tokenid = '0x ...'; // Out on the stroke tokens Erc721
Const anker = '0x ...'; // Outline the Metamask Koshole
Const Out = '1.000 Ether'; // to be replaced by the amount you want to buy
Buynft (Tokenid, Vladner, sum)
.Then ((result) => {
Console.log (Result);
})
.catch ((liner) => {
Console.error ('NT:', Error);
});
Conclusion:
The follow -up of this step and your code is your code with the calling of the Function UPPUUE
, pre -consumingBuy (_Tokenid) Do not forget to replace the coat (for example,
https: // polygon.io/,
_Tokenid`) with your fact.
Leave a Reply