Skip to main content
20 votes
Accepted

invalid opcode: opcode 0x5f not defined

This is because solidity 0.8.20 introduces the PUSH0(0x5f) opcode which is only supported on ETH mainnet and not on any other chains. That's why other chains can't find the PUSH0(0x5f) opcode and ...
Zartaj Afser's user avatar
  • 4,434
16 votes

HardhatError: HH700: Artifact for contract "Greeter" not found - clarification [Hardhat, openzeppelin]

Keep in mind that your solidity contract's name has to match, too. If you try to deploy with const License = await ethers.getContractFactory('License'); this works contract License {...} this doesn'...
r.beer's user avatar
  • 161
8 votes

An unexpected error occurred: Error: Cannot find module '@nomiclabs/hardhat-waffle' [Hardhat, openzeppelin]

The problem could be that you have not installed the hardhat waffle package. You should do: npm install -D @nomiclabs/hardhat-waffle ethereum-waffle then edit the hardhat.config.js file and add ...
phydy's user avatar
  • 146
7 votes
Accepted

Finding a Pair Contract on PancakeSwap

you're looking at the different PancakeSwap contracts versions. Example: PancakeRouter V1 - 0x05ff2b0db69458a0750badebc4f9e13add608c7f PancakeFactory V1 - 0xbcfccbde45ce874adcb698cc183debcf17952812 ...
Miroslav Nedelchev's user avatar
6 votes

invalid opcode: opcode 0x5f not defined

0x5f is the PUSH0 opcode which Solidity 0.8.20 started generating: This compiler switches the default target EVM version to Shanghai, which means that the generated bytecode will include PUSH0 ...
eth's user avatar
  • 86k
4 votes
Accepted

Why BNB Chain is not working?

Because BNB Chain is currently paused due to a hack related to Binance bridge It is paused only for this hack (not other hacks) It is not clear how it can be paused in the first place There is no ...
Mikko Ohtamaa's user avatar
4 votes

Uniswap Router initialization in Ethereum mainnet versus BSC

Yes, it's the difference of Binance vs Ethereum. Different chains might have different addresses for different contracts. On Ethereum, Uniswap's router is deployed on the second address you mentioned. ...
Kenzo Agada's user avatar
  • 1,226
4 votes

invalid opcode: opcode 0x5f not defined

Instead of going back to an older version of Solidity compiler, in hardhat to prevent use of PUSH0 you can try setting evmVersion to a previous version (e.g. paris, which is the one before shanghai) ...
SKYBITDEV3's user avatar
3 votes

What is the best way to create Binance Smart Chain (BSC) transactions via geth without a full node?

It look like BSC light node have issues since last update (see this GitHub issue for instance https://github.com/binance-chain/bsc/issues/452 ) As an alternative, Binance has free endpoint (https://...
DrGorilla.eth's user avatar
2 votes

BSC token swap API error with 0x.org

Based on the transaction tracing, it reverts because you did not approve an allowance to the 0x contract. Simply call the approve function on the token with 0xDef1C0ded9bec7F1a1670819833240f027b25EfF ...
Undead8's user avatar
  • 3,610
2 votes

How to deploy a contract on Polygon/Ethereum/BSC with shared state?

while keeping the same address ideally. Addresses are interchangeable between the networks. The smart contract address is the deployer address + nonce. You just use the same private key to deploy the ...
Mikko Ohtamaa's user avatar
2 votes

After all attempts to verify the smart contract, i keep getting PaserError - not found: File import callback not supported

Check out this page https://docs.openzeppelin.com/contracts/4.x/ First you do: $ npm install @openzeppelin/contracts And then import ERC20.sol like: import "@openzeppelin/contracts/token/ERC20/...
Severin's user avatar
  • 173
2 votes
Accepted

Getting the functions of an unpublished contract

To view the code: On the Contract tab of a given contract on BscScan, there is a button that says "Decompile ByteCode". Click that and you'll be taken to a new page called "EVM bytecode ...
Ryan Shea's user avatar
2 votes

HardhatError: HH700: Artifact for contract "Greeter" not found - this is the problem i'm getting [Hardhat, openzeppelin]

You have named your contract 'Nikola' and not 'Greeter'. The actual file-names only matter for imports.
phaze's user avatar
  • 1,615
2 votes

HardhatError: HH700: Artifact for contract "Greeter" not found - clarification [Hardhat, openzeppelin]

The problem is likely in your sample-script.js and you are referencing "Greeter" instead of "Nikola". If not, try deleting the artifacts/ and cache/ folders and retrying.
Dylan Kerler's user avatar
2 votes

reason: 'too many arguments: in Contract constructor', This is the last step before i deploy the contract, so any advice would be great

You are giving a string argument -> “Hello, Hardhat” when you are deploying the contract but your contract does not expect any arguments. So remove it and it should be -> const nicola = await ...
Majd TL's user avatar
  • 3,237
2 votes
Accepted

Why the BSC block gas limit change and what's the logic behind it?

I've been reviewing the source code for the bnb node (erigon version). I've discovered that it follows the same mechanism as Ethereum or Polygon in which in each block, the producer could vary the gas ...
Carlos Lostao's user avatar
2 votes

HardhatError: HH700: Artifact for contract "Greeter" not found - clarification [Hardhat, openzeppelin]

In my case i was using hre.ethers.getContractFactory("ZeeCard.sol"); Instead of just using "ZeeCard" without .sol at the end hre.ethers.getContractFactory("ZeeCard"); ...
Syed Zain Jeelani's user avatar
2 votes
Accepted

Nethereum: any pancakeswap contract function call results in "execution_reverted", all transactions fail with same error

Jesus christ, I finally managed to make it work, HUGE thanks to @tqdpham96 for pointing out to root cause... I believe I wouldn't be able to find this somewhere else as there is absolutely NO ...
Danik Logan's user avatar
1 vote
Accepted

Is it possible to simultaneously call a method from the children's smart contract by the parent's smart contract?

Yes, you can batch multiple transactions in one. just make a for loop, that calls each contracts transfer function. I presume all child contract have the same layout? You could do something like: ...
Nal Luksic's user avatar
  • 1,187
1 vote
Accepted

I got the exact same address for a contract deployed on both bsc and ethereum testnet

The address is the same because you used the same deployer address and nonce. You can read more details here.
Lauri Peltonen's user avatar
1 vote

View smart contract at previous block before self destruct?

It's doable, you must connect to an archive node's RPC and then you can pass overrides.blockTag when you call a contract method (I'm assuming Ether.js). To get an archive node you can host yourself ...
Andrea Ciceri's user avatar
1 vote
Accepted

SCAM: cannot swap back a token

this line in the transfer is prohibiting the transfer: def transfer(address _to, uint256 _value): # not payable ... if unknown1ee59f20Address == _to: revert with 0, 'Please wait' if you ...
phaze's user avatar
  • 1,615
1 vote

Decode constructor arguments of deployed Smart Contract

Have you seen the "Constructor Arguments" section in the page you linked? There you can see the values too (they are padded to 32 bytes (256 bits)) and simply ignore the first zeros since an ...
Andrea Ciceri's user avatar
1 vote
Accepted

Decode constructor arguments of deployed Smart Contract

You gave the answer =) they are 2 address, the first one is 0xb7926c0430afb07aa7defde6da862ae0bde767bc, for example. The issue is that addresses have 20 bytes, and the parameters have 32bytes. That is ...
João Paulo Morais's user avatar
1 vote
Accepted

Can't run smart contract (BUSD) method on android chrome using web3js and walletconnect

I needed to set up my own infura project (https://infura.io/) and get infuraId. UPD: I've decided to do it without infura. To solve problem with mobile version you will have to navigate your mobile to ...
Ernest Rutherford's user avatar
1 vote
Accepted

Place Orders on Pancake Swap from Code

Yes, like with any smart contract, you can call the functions directly from code with tools like web3js. In the case of pancakeswap, the easiest way is to call the functions on the router such as ...
Undead8's user avatar
  • 3,610
1 vote

HardhatError: HH700: Artifact for contract "Greeter" not found - clarification [Hardhat, openzeppelin]

Solution for Error HH700: Artifact for contract Above was the error I was getting as well. I have tried npx hardhat clean and npx hardhat compile. It did not work for me. what worked for me was: I ...
Enkh's user avatar
  • 11
1 vote

An unexpected error occurred: Error: Cannot find module '@nomiclabs/hardhat-waffle' [Hardhat, openzeppelin]

This answer is from Patrck Collins's solidity course. We need to delete the unwanted config file. Find it npx hardhat --verbose hardhat:core:config Loading Hardhat config from /Users/hardhat....
Mac Yang's user avatar
1 vote
Accepted

Estimate transaction fee on BSC

So basically the formula is: Gas Limit * Gwei amount / Gwei Denomination The total amount paid for transaction will obviously differ as it depends how much gas given function costs. But according to ...
Mugetsu's user avatar
  • 131

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