Category "solidity"

When compiling my solana code , I am getting "TypeError: Named argument "username" does not match function declaration."

pragma solidity ^0.8.4; import "hardhat/console.sol"; contract Ewitter{ struct User{ address wallet; string name; string username;

I wrote a solidity that pays ERC-20 tokens for ERC-721 NFT transaction, but it doesn't work

I wrote a solidity that pays ERC-20 tokens for ERC-721 NFT transactions, but it doesn't work. On purchase, you trigger the purchaseToken method. But I get an un

Error obtain data with React and Solidity

When call in my front (React) My code: const checkAllowance = await contract.GetAllowance.call({ from: account }).catch((e

Standard Common Practice Method in Solidity to perfrom any type of division?

I am trying to do the following calculation with solidity: 3,000 / 45,000,000 = 0.000067 with the following method: // SPDX-License-Identifier: MIT pragma solid

Adding Liquidity to Pancakeswap in Testnet

I need help with my code. I want to create a simple Smart Contract with adding Liquidity to Pancakeswap. I tried many different things, but the transaction alwa

Discrepancy between the getAmountsOut function and the prices on the exchange

I am making an app to get live prices of tokens from the different exchanges. To do this I'm using web3.py to access to the DEX smart contract and call the getA

Fail with error 'PancakeLibrary: INSUFFICIENT_AMOUNT'

I'm trying to fork PANCAKESWAP, everything seem to work well, I can add liquidity, but whenever I decided to add a liquidity that has to do with BNB (i.e callin

Time out error during Deployment in Binance Smart Chain

I got an error while deploying contract in Binance Smart Chain plz help me if anybody knows it error message looks like this Deploying 'WhitePaperInterestRat

How to use a getter function inside a React component?

I am trying to make a basic React component to retrieve a value from a deployed contract. In this example, I am using an input box to receive a contract address

i want implement ICO Contract for token contract

I have some simple ico contracts for airdrop and presale with lock token future to lock token until ico end and I want to know how to connect it to token contra

Can't import openzeppelin node_modules: File import callback not supported

Whenever I try to compile my solidity contract, the error ParserError: Source \"@OpenZeppelin/contracts/math/SafeMath.sol\" not found: File import callback not

ERC1155 Sell/Buy NFT Solidity

My contract for ERC1155 marketplace to mint buy and sell the NFT. The nft is getting minted , However the NFT is not showing in market place and not able to pur

File not exist Solc error when trying to import data feed into my contract

I have tried changing different versions of solc, solidity, and chainlink contracts but it doesn't work. Error: contracts/Lottery.sol:4:1: ParserError: Sourc

TransactionError when using Brownie on Optimism - Tx dropped without known replacement

I have a Python script using Brownie that occasionally triggers a swap on Uniswap by sending a transaction to Optimism Network. It worked well for a few days (d

How to access the data from the previous block of Ethereum block chain through the block number?

I am new to block chain. Suddenly I got a question did we can able to access the previous block data from the Ethereum block chain by block number. For example

How to implement a transaction fee on every transaction which will get rewarded to holders of the token?

I have tried to make a ERC20 token that takes a transaction fee on every transaction (buy/sell/transfer) and this transaction fee gets distributed amongst the h

How to send ether from eoa to contract

I need to send ether from externally owned account to contract. All code I found so far looks like this contract Contract { mapping (address => uint) ba

How to get one value from struct of array in solidity?

I want to get the value that is inside of struct in Solidity, but I have no idea how to get it. pragma solidity >=0.4.21 <0.6.0; contract PlaceList {

is two different ERC721 contract can mint same NFT

I'm learning blockchain development recently and I'm implementing ERC721 contract to mint NFT and store the mapping of ownership. What if I deploy a second cont

difference between interface and abstract contract in solidity

I am learning solidity and got to know that interface and abstract are both classes that may contain unused functions. My doubt is: What is the difference betwe