Questions tagged [contract-development]

Questions regarding the development of smart contracts

1,184 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
67 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 ...
user avatar
5 votes
1 answer
347 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 ...
user avatar
5 votes
0 answers
11k views

How does Uniswap calculate price impact without fee on the swap page?

Context: We are creating a smart contract which integrates Uniswap DEX for swapping Tokens to ETH. We need to make sure one swap does not impact the token price more than 3%. We are in need to write a ...
user avatar
5 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() ...
user avatar
  • 1,131
5 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 ...
user avatar
  • 7,739
4 votes
1 answer
235 views

which wallet supports access list(eip-2930)

I am trying to use Access List feature - Link here I am using also ethers.js.. It seems like that ethers.js supports passing access list, but Metamask doesn't yet support this feature. do you know any ...
user avatar
4 votes
1 answer
182 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. ...
user avatar
4 votes
0 answers
622 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 ...
user avatar
  • 41
4 votes
0 answers
345 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 ...
user avatar
4 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. The ...
user avatar
4 votes
0 answers
434 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; ...
user avatar
4 votes
1 answer
1k 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 ...
user avatar
4 votes
1 answer
149 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 ,...
user avatar
  • 41
4 votes
1 answer
939 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 ...
user avatar
  • 423
3 votes
0 answers
162 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 ...
user avatar
3 votes
1 answer
199 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 ...
user avatar
3 votes
2 answers
2k views

How to pass a blank bytes calldata into a solidity function call?

I have a function that looks like this: function foo(uint _someVar, bytes calldata _data) public { ... } Then I make a call to it from another function with "" as _data: foo(123, "&...
user avatar
  • 131
3 votes
0 answers
301 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 ...
user avatar
3 votes
1 answer
105 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 ...
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: ...
user avatar
  • 297
3 votes
0 answers
359 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/...
user avatar
  • 297
3 votes
0 answers
545 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 ...
user avatar
3 votes
0 answers
94 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' ...
user avatar
3 votes
0 answers
748 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: ...
user avatar
3 votes
0 answers
126 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 ...
user avatar
3 votes
0 answers
625 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. ...
user avatar
  • 663
3 votes
1 answer
1k 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 ...
user avatar
3 votes
0 answers
222 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 ...
user avatar
  • 1,533
3 votes
0 answers
76 views

Methods and constants order in the contract ABI

Is it possible to annotate methods and constants order in the contract ABI before compilation?
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! ...
user avatar
  • 51
3 votes
0 answers
274 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 ...
user avatar
3 votes
2 answers
1k 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 ...
user avatar
3 votes
0 answers
165 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 ...
user avatar
  • 246
3 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 ...
user avatar
  • 1,077
3 votes
0 answers
543 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 ...
user avatar
3 votes
0 answers
142 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 ...
user avatar
  • 31
3 votes
1 answer
146 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?
user avatar
3 votes
0 answers
48 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). ...
user avatar
  • 3,147
3 votes
0 answers
479 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 ...
user avatar
3 votes
0 answers
320 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 ...
user avatar
  • 1,127
3 votes
0 answers
139 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 ...
user avatar
  • 3,147
3 votes
0 answers
103 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 ...
user avatar
  • 3,425
3 votes
0 answers
146 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 ...
user avatar
3 votes
0 answers
129 views

Using Mix IDE on a private testnet?

Is it possible to run/debug contracts in mix-ide on a private test net?
user avatar
  • 5,164
3 votes
0 answers
151 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 {....} ...
user avatar
  • 1,896
3 votes
1 answer
364 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 ...
user avatar
  • 877
3 votes
1 answer
2k 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....
user avatar
2 votes
0 answers
43 views

Uniswap V3 NonfungiblePositionManager mint() using truffle/hardhat reverts without reason string

I want to initialize a new liquidity pool and add initial liquidity using uniswap V3-periphery library, using truffle/hardhat as the dev environment. I set hardhat to fork mainnet using infura. Here ...
user avatar
2 votes
1 answer
148 views

Unable to change solc version used by dapp tools

I am using ubuntu 21 LTS version and trying to compile and run pickle.finance contracts using dapp.tools. The steps are mentioned here https://github.com/pickle-finance/protocol. I followed till the ...
user avatar
  • 812
2 votes
1 answer
272 views

The script at 'https://binaries.soliditylang.org/wasm/soljson-v0.8.1+commit.df193b15.js' failed to load

I'm using Remix online and when switching to any version higher than 0.5.1, I get the following error: Worker error: Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': ...
user avatar

1
2 3 4 5
24