Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
2 votes
Accepted

error while verifying my contract on Ropsten network

i think that the error was in this command: env $(cat .env) npx hardhat verify --network rinkeby 0x86... . i tried to import my env variables in hardhat,config.js like this: const ETH_API_KEY = ...
user avatar
  • 41
2 votes
Accepted

How to concatenate strings in solidity?

As of Feb 2022, in Solidity v0.8.12 you can now concatenate strings in a simpler fashion! string.concat(s1, s2) Taken directly from the solidity docs on strings and bytes: Solidity does not have ...
user avatar
2 votes
Accepted

Check condition on all elements of an array

That's about it. You can save some gas though: function pickNumbers(uint[5] memory _stdNumbers, uint memory _specialNumber) public { for(uint i=0; i<5;) { require(_stdNumbers[i] > ...
user avatar
  • 3,124
2 votes

What makes this a scam ? - fell for it and wanted to know why I was not able to sell - as a dev what was he able to do

Alright, I took a closer look at this. And these are the obvious issues I see here. transfer() function works by calling doTransfer from Accounting interface. Meaning that transfer functionality is ...
user avatar
  • 592
2 votes

How can I automate the crypto payments using smart contract?

I'm assuming from the question you want to know if there is a way to fund a contract so it performs as expected, because when it runs out of funds the program stops? Disclaimer: I am part of Chainlink ...
user avatar
1 vote
Accepted

Why do people like use erc721 to public NFT instead of erc1155?

There is one main thing that ERC-721 does that ERC-1155 doesn’t — you can ask a ERC-721 contract who the ownerOf(itemId) is, whereas on an ERC-1155 contract you can only check whether a specific ...
user avatar
  • 803
1 vote

Is it faster to access variables in bulk rather than requesting them one by one?

All data reads are slow. I'm not 100% sure, but most likely it would be faster to access your values function, since it reads all the data in one go. Retrieving each data separately is forced to ...
user avatar
1 vote

How do you import a custom unlocked account from Ganache-CLI into MetaMask?

Hmm.. if you are forking a Mainnet and trying to import accounts that is generated in Mainnet public chain and not yours, then you cannot import it in Metamask! If it was possible then you could use ...
user avatar
  • 323
1 vote
Accepted

Operator += not compatible with types String memory and bytes memory?

Here is the working version of your code that concentrates bytes and separates Numbers from Letters (What I asssume you wanted to do here). Hope it helps. // SPDX-License-Identifier: GPL-3.0 pragma ...
user avatar
  • 592
1 vote
Accepted

delegate call from a fallback function using msg.data doesn't work

the problem is in the space between the comma and the second uint256 try this: abi.encodeWithSelector(bytes4(keccak256("setVar(uint256,uint256)")), _a, _b) instead of "setVar(uint256, ...
user avatar
1 vote

how to get the length of an array of structs?

from the doc: If you have a public state variable of array type, then you can only retrieve single elements of the array via the generated getter function. This mechanism exists to avoid high gas ...
user avatar
1 vote
Accepted

im trying to call the bid function on my bidding contract from an outside contract but im getting "undeclared identifier" error... please help

In your bidding() function, you must declare the parameters to pass to EnglishAuction instance. In your case, when you define bidding() function you didn't declare the following parameters: _nft ...
user avatar
  • 1,260
1 vote

How to deploy a Vyper smart contract? Remix fails to compile

You can run compile locally using vyper module. pip install vyper==0.3.1 You can read more about vyper. Start the vyper server by following command vyper-serve -b localhost:8000 Verify the vyper-...
user avatar
1 vote

What makes this a scam ? - fell for it and wanted to know why I was not able to sell - as a dev what was he able to do

I suspect the doTransfer function hides the code which doesnt let you to sell.The function is implemented in another contract so you wont be able to check the exact code until you have the address of ...
user avatar
  • 73
1 vote

"Struct containing a (nested) mapping cannot be constructed" Error

To solve your problem, you can use push() method for create a storage slot into your struct array about new Request struct instance to insert and then you can fill it with the input values that passed ...
user avatar
  • 1,260
1 vote

HELPP!! What is wrong with my mint function?

Figured out the issue... The URL in my hardhat config was pointed to the wrong network on Alchemy.
user avatar
  • 13
1 vote

How to enable meta-transactions for Polygon contract

UPDATE: I have followed the instructions here: https://docs.opensea.io/docs/polygon-basic-integration#meta-transactions and here: https://github.com/ProjectOpenSea/meta-transactions/blob/main/...
user avatar
  • 31
1 vote

insufficient gas funds error on rinkeby infura using brownie

Adding on to @Majd TL's helpful observation there, if you'd like to see the various ethereum addresses that get generated from your mnemonic (aka seed phrase) take a look at the answer to this post on ...
user avatar
1 vote

Can I make 'wait n seconds' statement in solidity function?

The blockchain is synchronous by design and doesn't allow you to perform actions between blocks in a single transaction. This means, that if you want to "wait X seconds and then do something else&...
user avatar
1 vote
Accepted

Solidity 128.128 unsigned fixed point division

Okay, so I'll post the solution here for the next guy. Shoutout to the comments for the helpful hints. The key here is one of the more obvious facts that you can break up a fraction with a common ...
user avatar
1 vote

How can I automate the crypto payments using smart contract?

You can automate crypto payments with something like Gelato Ops.
user avatar
1 vote

need ideas for blockchain dapp that gives information on wait times

while it's not your specific use case, here's an example of a 'gig economy' use case involving smart contracts, where a tesla owner and a customer agree on a contract to rent out the tesla to the ...
user avatar
1 vote

Solidity statement with a uint on a line by itself

Unfortunately I don't have a definite answer for you, but at least something. I've seen this kind of use when the developer wants to silence a warning. An unused variable causes a warning, but in some ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible