Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [contract-development]

Questions regarding the development of smart contracts

1,157 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
113 views

How to Measure and Manage Witness Size

In https://ethresear.ch/t/the-eth1-eth2-transition, Vitalik wrote: If you are a developer, you can eliminate the largest part of disruption from gas cost changes by proactively making sure you ...
Eric Falkenstein's user avatar
6 votes
0 answers
699 views

how to decode/encode ipfs for contracts

It's known that IPFS can use 2 types of CID, v0 and v1. In my contract, I let users store bytes data parameter. They can store some simple text on it or even pass the ipfs hash. This question is about ...
Nika Kurashvili's user avatar
6 votes
2 answers
2k views

Contract creation gas cost depends on code in library function?

I have a contract fooContract which is using a fooLib library, calling fooLib.foo(LibStruct storage param) The transaction cost to create fooContract seems to depend on the code in the fooLib.foo() ...
szerte's user avatar
  • 1,241
6 votes
1 answer
2k views

Solidity: How could I decrease gas usage of complex structs?

Struct is very expensive as labelled here: It seems extremely expensive when storing struct type. https://www.cryptocompare.com/coins/guides/what-is-the-gas-in-ethereum/: sstore 100 Paid ...
alper's user avatar
  • 8,395
6 votes
0 answers
2k views

How can we lock an ERC20 token in a contract and generate another ERC20 token proportionally over the locked duration?

"Gnosis tokens (GNO) are the generator for Wisdom token (WIZ) creation. WIZ can only be created via activating the utility of the Gnosis (GNO) tokens. This is done via a smart contract system. ...
trivikramak's user avatar
5 votes
2 answers
448 views

How would an nft marketplace structure their smart contracts to pay out "creator shares"?

This may be a noob question, but does any know how a market like Nifty or any similar nft marketplace actually implement paying a "creator share" or royalty back to the original creator ...
AdjunctProfessorFalcon's user avatar
4 votes
0 answers
111 views

How the mimc bug from circomlib was safely exploited in practice on Tornado Cash?

Several years ago, there was an unenforced constraint on verification in the cirmcomlib library : a tool for building projects using ZsNarks. The error allowed to forge cryptographic nullifiers/proofs ...
user2284570's user avatar
  • 1,018
4 votes
1 answer
291 views

How to prove root chain (Ethereum) NFT ownership from L2 (Polygon/Matic) Contract

I'm building a system that allows a user to "claim" a ERC1155 NFT on Polygon/Matic if they own a certain ERC1155 NFT on the root network (ethereum). My current solution works off-chain, by ...
turtlesoupy's user avatar
4 votes
1 answer
188 views

How to deploy existing DAPP to my private ethereum node?

I am looking to build a PoC around a trading platform on a block chain platform. I am trying to deploy the dapp available here to my local ethereum node. Package contains: a. HTML frontend part b. ...
siddrahil's user avatar
4 votes
1 answer
2k views

Truffle Bytecode Different from Etherscan Bytecode

I am having difficulty verifying my contract code on Etherscan using the code generated by Truffle. Using Etherscan VerifyContract V1: https://rinkeby.etherscan.io/verifyContract Truffle produced ...
Nyxynyx's user avatar
  • 1,167
4 votes
0 answers
655 views

Managing multiple Ether addresses in one contract?

Although I have a background in Bitcoin (creating the WLOX exchange platform), I am completely new to Ethereum. I am trying to find a way to manage multiple accounts/addresses as a pool to (1) be ...
mbassan's user avatar
  • 41
4 votes
0 answers
370 views

Storing a truffle contract interface in version control

What I'm doing When I compile and deploy a contract using Truffle, I get a .json build artifact that contains information about where the contract is deployed on the network (its address). So far I ...
Travis Jacobs's user avatar
4 votes
0 answers
439 views

Event and/or watch does not work

I have a contract for a simple bidding scenario as below: pragma solidity ^0.4.9; /* Contract accepting biddings during 30 minutes */ contract SimpleBidding { address contractOwnersAccount; ...
Önder Gürcan's user avatar
4 votes
2 answers
2k views

Sending string to deployed contract function

var source = fs.readFileSync("./vote.sol", "utf-8") var compiled = web3.eth.compile.solidity(source); var abi = compiled.identify.info.abiDefinition; var Vote = web3.eth.contract(abi); var ...
nick carraway's user avatar
4 votes
1 answer
152 views

How to work with inherited contracts in EthereumJ?

In EthereumJ, I have two contracts i deployed them individually,first one was deployed but for the second i got error as in that i was calling function of first one and example i have second is first ,...
Gagan's user avatar
  • 41
4 votes
1 answer
1k views

How do I connect to the Remix JavaScript VM from my front end

I have been developing using Remix and Metamask but it's a slow progress when pushing to the test networks. I have switched to the JS VM in Remix but I am not sure about how to connect my frontend to ...
ORStudios's user avatar
  • 443
3 votes
0 answers
1k views

hardhat verify contract faild! Help!

I use command npx hardhat verify, and the log is: Nothing to compile No need to generate any newer typings. Successfully submitted source code for contract contracts/ygu/yguToken.sol:YGUToken at ...
euclan's user avatar
  • 31
3 votes
0 answers
491 views

How can I do contract call transaction from Metamask qr code scan?

I have a payable function in the smart contract that takes some ether from the sender and does some tasks. I want to generate QR code for this contract call transaction so that user can scan and ...
Abishek Bashyal's user avatar
3 votes
0 answers
383 views

Interfacing with Uniswap/Pancakeswap locally

I'm interacting with PancakeSwap for the first time, as I'm developing a token that interfaces with PancakeSwap. Ideally I'd like to iteratively test it without deploying to a live network. Must I ...
user4367814's user avatar
3 votes
1 answer
116 views

how do I know that NFT is from the right person

I understand the NFT (at least solidity part).. There's something that's bugging me though. Let's say someone made a super great cat(cat1), published it to ipfs, then called the ERC721 contract and ...
Nika Kurashvili's user avatar
3 votes
0 answers
2k views

Swap tokens to Ether on Uniswap V2 TRANSFER_FROM_FAILED

I am trying to swap DAI to ETH on kovan testnet my wallet and contract both have DAI tokens. Whenever I swap the token through web3 the transaction fails Fail with error 'TransferHelper: ...
Marr's user avatar
  • 337
3 votes
0 answers
429 views

solc unable to import scoped packages

I am trying to import these lines on solidity and compile it with solc import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol'; import '@uniswap/v2-periphery/contracts/interfaces/...
Marr's user avatar
  • 337
3 votes
0 answers
3k views

How to Download source code of existing smart contracts on ethereum block chain

We are working on a project which requires smart contract source codes for analysis in ethereum blockchain. Can anyone suggest us how to download the source codes of various smart contracts already ...
Ravi Teja K.R.'s user avatar
3 votes
0 answers
691 views

Anything like a static delegatecall from a view function?

let's say there are two contracts A and B, where A calls methods in B. I understand that A can modify and read storage in B with B.call() and B.staticcall(), ie. A can execute B's methods in the ...
hellopeach's user avatar
3 votes
0 answers
105 views

One-to-many mapping inside struct

I have two structs: struct A{ uint bid; mapping(uint => B[]) BMap; //bid - index for struct B } struct B{ uint cid; } mapping(uint => A[]) AMap; How can we push and fetch 'cid' ...
angelmaria's user avatar
  • 1,061
3 votes
0 answers
993 views

Can I extend the interface of a contract without redeploying it?

The case I'm dealing with is a contract which should serve as a Data Abstraction Layer. So ideally, it should provide only getter functions and setter functions. For example, my interface is: ...
goodvibration's user avatar
3 votes
0 answers
185 views

Zero Knowledge Range Proofs

I am new to the world of Zero Knowledge Range Proofs. I read the following on GitHub: https://github.com/ing-bank/zkproofs The Zero Knowledge Range Proof allows the blockchain network to validate ...
Heba Mohsen's user avatar
3 votes
0 answers
684 views

Questions on MinterRole contract in openzeppelin

I am using the openzeppelin for creating the ICO contract. I am concerned about the MinterRole here. After I develop Token contract, I added the sale contract as a minter using "addMinter" function. ...
iappmaker's user avatar
  • 813
3 votes
1 answer
1k views

How to implement percentage deposit function to smart contract

I need to implement on the deposit function when the ownerAddress is doing a deposit a 10% to be freeze in the smart contract and and if the ownerAddress want's to call the returnDeposit function by ...
fortza italia's user avatar
3 votes
1 answer
2k views

ERC223 Token Fallback Function Usage

I'm currently writing the "Trade" smart contract which is similar to "Crowdsale" smart contract. The only function that I want to add is "sell" function. In general Crowdsale smart contract is used ...
rachel_hong's user avatar
3 votes
0 answers
293 views

How to parse through the logsBloom of a block or transaction using solidity

Currently trying to figure out how to parse through the logsBloom portion of block and transaction headers using solidity. I've researched the topic so far and have come to the understanding that RLP ...
hextet's user avatar
  • 1,583
3 votes
0 answers
80 views

Methods and constants order in the contract ABI

Is it possible to annotate methods and constants order in the contract ABI before compilation?
Dmytro Zarezenko's user avatar
3 votes
0 answers
1k views

contract.method.getData getData is undefined

When I use contract.method.getData(params) it throws an error getData is undefined. I searched on github and saw someone used request instead, and I used contract.method.request and it has successed! ...
Jack LI's user avatar
  • 51
3 votes
0 answers
303 views

Benefits of library versus a plain contract (upgradeability)

I'm trying to find what the benefit is of a library. I found the following statements. (Please correct me if i'm wrong) Cost less gas to deploy Uses the storage of the calling contract the library ...
just_trying_stuff's user avatar
3 votes
2 answers
2k views

How to set dynamic buy and sell price for my token?

I have built a simple erc-20 token. I used the code given on ethereum.org code as a reference. There they have talked about setting the price of my token. But how do I set it dynamically, as in ...
sushantmit's user avatar
3 votes
0 answers
173 views

Smart contracts and ICO questions

I am trying to learn and understand how ICOs and the smart contracts used in them work and I am having a hard time understanding the following: Take for example ParagoinCoin, you can see here that it ...
Julien's user avatar
  • 246
3 votes
0 answers
556 views

Smart Contract for accepting multiple ERC20 Tokens

If I wanted a smart contract to send tokens based on the exchange price of the ERC20 token received, or any agreed upon value in US dollars how would I do so? For example, If i wanted my tokens to ...
CryptoNewbie's user avatar
3 votes
0 answers
144 views

Identity valuation using smart contracts

Hi I'm currently exploring whether it makes sense to build a platform which would use a blockchain to verify a user and the data that they would add to the platform. Very simple example would be ...
manyash's user avatar
  • 31
3 votes
1 answer
180 views

Is it possible to verify a signature computed with a X.509 smartcard inside a contract?

I plan to provide a X.509 certificate and a signature as contract parameters. What would be the process to verify the signature in the contract?
user2715109's user avatar
3 votes
0 answers
50 views

Is there any way to generate cheap proofs of Ethereum's state?

A contract on the Ethereum network can interact with other contracts within it without requiring any proof, because the system itself defines methods for cross-contract communication (SEND, CALL). ...
MaiaVictor's user avatar
  • 3,177
3 votes
0 answers
483 views

Ethereum and child chains like NXT/Ardor?

Doing some research on how we can implement this type of system with ethereum smart contracts. Currently the upcoming Nxt/Ardor system implements a child chain system where the main chain deals with ...
Patoshi パトシ's user avatar
3 votes
0 answers
323 views

How to debug Bad jump destination error

I am trying to work through the https://ethereum.org/token#improved-coin tutorial. I deployed the contract to testnet. Initialized tokens, set the buy and sell price. Now, one of my accounts has 50 ...
maheshmurthy's user avatar
  • 1,237
3 votes
0 answers
144 views

Is there any reference on writing contracts directly with the bytecode language?

It would be great to have a complete reference of all the opcodes available, their exact effects and costs, and an example "Hello World" in ethereum assembly. Edit: this question isn't a duplicate of ...
MaiaVictor's user avatar
  • 3,177
3 votes
0 answers
106 views

Contribute function of crowdsale is not working

I am having a crowdsale contract. I am trying to run contribute function using command: contractInstance.contribute.sendTransaction(101,{from:eth.accounts[0],value:200, gas:4000000}). It is creating a ...
Aniket's user avatar
  • 3,545
3 votes
0 answers
148 views

How to enable autobuy of Ethers in exchange of my CryptoCurrency?

I'm referring this page : https://www.ethereum.org/token#automatic-selling-and-buying My question is that how is it possible to integrate third party in our Smart Contracts to be deployed on Ethereum ...
Ayush Aggarwal's user avatar
3 votes
0 answers
131 views

Using Mix IDE on a private testnet?

Is it possible to run/debug contracts in mix-ide on a private test net?
Sebi's user avatar
  • 5,284
3 votes
0 answers
163 views

How to use an accessor for imbricated data types?

I'm looking at information about accessors in solidity/js for more complex data structures than just a public array/mapping. How can i access the array in that code for: struct AnotherStruct {....} ...
user697's user avatar
  • 2,176
3 votes
1 answer
738 views

Keepers with VRF Error "Callback gas limit set too low error"

Im trying to create a dynamic nft by following the tutorial by alchemy, the NFT should update when performUpkeep is called which should get a random number using VRF v2 and change the NFT token URI. ...
abdulqgg's user avatar
3 votes
1 answer
467 views

What is the maximum computation a query or constant function in solidity can perform?

Since query or constant functions are just executed on single node there is no dependency on gas or gas limit. I am performing Quicksort in query/constant method. EVM can sort an array of length up to ...
Subhod I's user avatar
  • 927
3 votes
1 answer
3k views

What is the burn() and burnFrom() function in EThereum Token Creation contract?

Please find the below ethereum token creation contract. It has two burn functions. It is having redendent params also. Why it is placed, what is the importance of the functions. pragma solidity ^0.4....
Seetharaman GR's user avatar

1
2 3 4 5
24