Category "solidity"

How to decode Token Address from a given Pair Address in web3

What I am trying to accomplish is to get the Contract Address 0x1ada8bb610c59aae25d8dd8f354282f5693cefb1 given the LP Pair address 0x0D0b63b32595957ae58D4dD60a

How do I resolve this Hardhat CompilerError? (Stack too deep when compiling inline assembly)

I'm analyzing the Chainrunners smart contracts, so I went on Etherscan and copied the verified contract source code. When I tried to compile without solidity op

How can accept other token in my Smart Contract?

The token is ERC721 by OpenZeppelin I'm trying to add USDC payments to my Smart Contract, but I'm having problems. This is my function to accept token.. but tra

Initialize a Merkle tree of 8 with blank leaves in solidity

I am trying to initialise an empty merkle tree in the constructor my solidity contract I have a merkle tree of 8 leaves, so that means that the flattened out fo

Solidity - Invalid BigNumber string (argument="value" value="" code=INVALID_ARGUMENT version=bignumber/5.4.2)

solidity newbie here. when I try to read the value of the people array. I'm getting an error: call to SimpleStorage.people errored: Error encoding arguments: E

Getting an error when trying to execute the deploy script

I'm getting a Transaction reverted without a reason string when I try to execute the deploy script. Smart Contract: //SPDX-License-Identifier: MIT pragma solid

Sending Custom Token as Dividend

how can i send a custom Token as Dividend with event SendDividends(uint256 tokenAmount, uint256 bnbAmount); but like token instead of bnbAmount

How to concat two string values in Solidity

Concat two or more string values- pragma solidity 0.8.9; contract StringConcatation{ function AppendString(string memory a, string memory b) public pure re

npx hardhat doesnt creates a new project

I tried creating a new hardhat project. I tried the following commands in terminal. npm init --yes npm install --save-dev hardhat But when I use the following

Solidity - ImportError: cannot import name 'VRFCoordinatorMock' from 'brownie'

Would really appreciate any help on this error. I've tried several things and reviewed the contracts for VRF, but I can't seem to figure it out. All the other t

Turning an ERC721 mint contract to store funds and accept payments

hope all is well. I have been following Dapp University tutorial (https://www.youtube.com/embed/x-6ruqmNS3o?start=2111) to make a mintable NFT pairs game. I am

Solidity - Send array of tuple data with address and amount

I'm working on a Solidity Smart Contract for Tron Network. I want the owner can set an array of address => uint. This is the code: pragma solidity ^0.8.0; s

using _hashTypedDataV4 in smart contract and _signTypedData(etherjs) in frontend is not working

i am trying to encode the nft data using _signTypedData(etherjs) in frontend as follows const domain = { name: "og-nft", version: "1", }; const typ

I have IRC20.sol file in next panel so why it wrote that not found?

I try solidity. I import some required files but now I see Error: not found IERC20.sol But I don´t know why, because this file is next... Thank you for re

Stop the time within the test in Hardhat (Solidity)

Is it possible to stop the time within the test, until the time is changed manually via "evm_increaseTime" in Hardhat? For example when we increase time by 1 se

Hardhat compile error "Expected a value of type HttpNetworkConfig"

I'm attempting to follow the NFT tutorial here. I have set up the accounts on Alchemy and Metamask created the .sol file. I have a .env file in root that look

Version of Node.js which not supperted by hardhat, but I have LTS version of node

I installed nvm in Ubuntu 20.04. Then using nvm I installed node and npm. The general task is to use hardhat in my Solidity project. I created npm project and i

'export' in VS code show problem statement "Declaration or statement expected." and cannot find name 'WEB3_INFURA_PROJECT_ID' and 'PRIVATE_KEY'

I am trying to create a ERC20 standard token using VS code by following a Youtube video https://www.youtube.com/watch?v=8rpir_ZSK1g . Until I reached the .env f

How to call external contract with abi.encodeWithSignature with no arguments?

I'm using solidity 0.5.16 and in a contract's function, I want to make a call to another contract's initialize() method. This method does not take in any argume

Error: missing revert data in call exception while testing with Hardhat

I want to test get my function TokenUri using hardhat. Here it is: function tokenURI(uint256 tokenId) public view virtual override returns (string memory){