Category "solidity"

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

How to get the price of BSC token directly the token pool contract in web3.py

I'm trying to get the price of some BSC token directly from the contract. Doing some searches, I found a mix of ideas with the snippet below. I'm sure the code

Solidity-Type address not convertible to type uint256

I created an array of structures and then tried to get the values of each account of an array. But I failed with an array while passing the address variable whi

How to handle user login in Ethereum DApps?

I have locally created a DApp in Solidity for Ethereum framework. I have a smart contract, a js file (using web3 API) and html file. What I want to achieve is t

Solidity - Solidity code to Input JSON Description

I want to compile my ethereum HelloWorld.sol smart contract. In all the tutorials is that you do it like this: var solc = require('solc'); var compiledContract

from field must match key's x, but it was y

I write the code below. It seems it has a problem with the "signed_txn = w3.eth.account.sign_transaction(transaction, private_key=private_key" part. I face to t

return nested array solidity

Is it possible to return an array in solidity? // SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; pragma experimental ABIEncoderV2; contract

deploy solidity contract with c#

I am developing an application on Ethereum blockchain. I use Solidity for contract and Nethereum c# library to connect to the contract. I am somehow new in Ethe

What's the difference between .deploy() vs. .deployed()

I am writing a script for a smart contract that I'll deploy using hardhat. I'm confused on the difference between .deploy() and .deployed(), what does each one

Trouble using python/brownie in WSL

I'm trying to complete the simple collectible NFT tutorial from this freeCodeCamp video. (I'm getting stuck on the script that starts exactly where the link is