New answers tagged

0 votes

Transfer erc721 token to another address

let account1 = '0x4D440d6A6b4391deDd8799815988e7A4c87b8c64' let account2 = '0xaC34c896f0c0199888354FE5e0017b60A6b56216' async function transferFromNFT() { const nonce = await web3.eth....
user avatar
2 votes

ERC777 upgradeable deployment error: cannot estimate gas; transaction may fail or may require manual gas limit hardhat

I had the same problem and I tried to use "hardhat-erc1820", but it didn't work well, so I changed it a little and it worked,here is my code , This is a full deployment of ERC1820 and ERC777 ...
user avatar
0 votes

Transfer erc721 token to another address

Long story short : You need to approve first In transferFrom() if caller is from you dont need to approve. Thats why your transaction was sucessful In safeTransferFrom() you need to approve your token ...
user avatar
0 votes

Transfer erc721 token to another address

Do you need to call the approve method before calling the transferfrom method? I directly call the transferfrom method and send it successfully, but the smart contract method is not called in logs ...
user avatar
2 votes
Accepted

Private variables with public view functions

The pattern you noticed is competing with the approach of using an internal storage variable. The general idea here is you can read the variables and not write. It allows the contract to make some ...
user avatar
0 votes

Is automating the withdraw of a NFT smart contract a good idea?

You can automate the call with Chainlink Keepers and schedule the withdrawal of the amount to the owner's account. However, there is a principle called, PULL OVER PUSH in solidity. It says never send ...
user avatar
0 votes

Is automating the withdraw of a NFT smart contract a good idea?

you cannot automatize the withdrawal just by writing solidity code because smart contracts execute code only in reaction of an external event. If someone calls it, it reacts and executes some code. ...
user avatar
  • 101
0 votes
Accepted

Is automating the withdraw of a NFT smart contract a good idea?

assuming that by "withdraw" you mean transferring the minting revenue to the owner. An automatic withdraw every 24 hours isnt possible. Smart contracts can't do anything automatically. Doing ...
user avatar
  • 1,328
0 votes

Function Max mint per wallet is not working

Ok so I see what you did here. You made it so that a user cannot with 1 single transaction, mint 2 tokens with your "mintCompliance modifier". BUT What you really want is that a single ...
user avatar
0 votes

Function Max mint per wallet is not working

I think you are not increasing the stored value inside the map. function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount){ if(msg.sender != owner()){ require(!paused, '...
user avatar
  • 2,536
2 votes
Accepted

Call smart contract function from another smart contract

You can think of the call from contractB to contractA as an additional "internal transaction", so it still has to adhere to the rules of contractA. In other words, since your mint function ...
user avatar
  • 170
1 vote

Initializing the implementation contract when using UUPS to protect against attacks

A proxy works by borrowing mirroring all the execution logic of an implementation contract. The context of the proxy contract is kept, however (meaning the storage is read and written to in the proxy)....
user avatar
  • 1,229

Top 50 recent answers are included