Questions tagged [contract-deployment]

The act of pushing a compiled smart contract in byte code to the Ethereum blockchain.

Filter by
Sorted by
Tagged with
1
vote
1answer
13 views

Several small or one big contract? (deloyment cost)

Does deploying several small contracts use more gas than deploying them as one, bigger contract with the same functions (that don't interact with each other)? How much is the difference?
0
votes
1answer
27 views

how does gas get taken from the account?

Let's say we call the function: function nice(uint a) public returns(uint256){ k = 100; z = 100; f = 100; require(a == 5); ...
0
votes
0answers
13 views

why can I specify `memory` if function is internal?

In the latest compiler versions, we can do the following: function balanceOf(uint[5] memory data) external view returns (uint256) { Until some version of the compiler, i couldn't specify memory, ...
0
votes
0answers
17 views

how does calldata not work in this case?

pragma solidity ^0.7.4; contract D { function test2(uint[1] calldata good) external { uint c = good[0]; } } This code is perfectly valid. What I do is deploy ...
0
votes
0answers
8 views

what's the difference between assembly part and opcode part in remix?

In the remix, there's compilations details button. When you click, one can see Bytecode and also assembly parts. Bytecode is an object which has object key and opcodes key in it. As far as I can see, ...
0
votes
0answers
16 views

ethereum solidity - gas cost wrong

This is bugging me so much time and spent hours and hours on this, I'd really appreciate your help so much.... // this costs 21394 function test2() external { } // this costs 21507 function ...
0
votes
1answer
9 views

Initialize function is not invoked during deployment of upgradeable contract

This is initialize function of my upgradeable contract contract MyContract is Initializable, ERC20PresetMinterPauserUpgradeable, OwnableUpgradeable { function initialize(string ...
1
vote
1answer
28 views

How much C++ is needed to write smart contracts?

Solidity seems to be written in C++ so does that mean that smart contracts require some level of C++ programming skills to get by? How much background knowledge is required for writing a simple one or ...
1
vote
1answer
18 views

Ethereum storage - how does this cost happen?

contract A { uint x = 10; function test2() public { x = 0; } } I can see that: Transaction cost is 13204 Execution cost is 5136 How can this be ? I ...
1
vote
0answers
47 views

Ethereum cost - how does it work in memory

This is really bugging me and doesn't seem any article that can help at all. wiki says further the gas costs for using memory: The fee for expanding memory is determined via a subtract-the-integrals ...
1
vote
1answer
17 views

what is expansion cost?

I am trying to understand what expansion cost is. We can see that there's this formula to count the memory cost - Now, It's also said that this formula doesn't include the expansion cost. Can anyone ...
3
votes
1answer
48 views
+250

how can library change state?

I have Very Interesting cases about Libraries. CASE 1: I read the following in the official solidity docs: Library functions can only be called directly (i.e. without the use of DELEGATECALL) if they ...
0
votes
1answer
14 views

how does library end up in contract?

library C { function a() public returns (uint) { return 15; } } contract A { function a() public returns (uint) { return C.a(); } } This is the code I am using. I ...
0
votes
0answers
10 views

how do i call a constructor from another constructor?

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.3.0/contracts/token/ERC20/ERC20.sol"; contract MyToken is ERC20 { constructor(uint supply) public { // ...
0
votes
0answers
11 views

“Revert: VM Exception while processing transaction” while trying to swap with 1Inch

since a while I am trying to program a swap contract for 1Inch. The problem is that I always get a Revert message when trying to call the function. I made sure that the contract has enough funds from ...
0
votes
0answers
16 views

Stuck ERC20 tokens appearing in a different contract

I have 1000s of token called ERC20 still stuck. I found them when trying to find missing SPANK on MEWconnect which only shows 1% of the SPANK I thought I had. If i select the spank contract on ...
0
votes
0answers
12 views

The data type of the return value of the solidity function has changed

As you can see, I have designed a struct in the solidity.There is a function in the solidity with the return value type User mapping(address => User) public _userInfoMap; struct User{ uint ...
0
votes
2answers
27 views

Token Contract Verified and Signed on Mainnet Does Not Show MINT Function

The Token Contract Address https://etherscan.io/address/0xa2e7a0d1cfeda4d3977277265e205f6092d02e3b was successfully tested on Ropsten (See Ropsten Contract Address ...
0
votes
1answer
26 views

Old contracts data not visible if pushed new contracts?

I created a contract campaign and deployed this contract in infura , then I called some functions of the contract which created the subsequent data(as in list of ongoing campaigns) in blockchain. In ...
0
votes
0answers
27 views

Trying to work with ganche-cli, truffle and infura

When trying to migrate a truffle-config.js file following error appears. TypeError: Cannot read property 'fromMasterSeed' of undefined any help would be much appreciated. const HDWalletProvider = ...
0
votes
1answer
19 views

10 Gwei contract creation is stuck

I need help, I want to add more gas to my token/contract creation, but there is no Nonce since it's pending, how can I get this contract live/mined via Remix Ethereum IDE? With average gas, does $90 ...
0
votes
0answers
28 views

Cannot Deploy to Rinkeby using Truffle, Infura, and Node

I am trying to deploy a contract to Rinkeby using Node and Truffle but I get a lengthy error: Truncated Error: Attempting to deploy from account 'MYACCOUNT#' [object Object] [object Object]...
0
votes
0answers
17 views

How can I compile multiple smart contracts in a single compile.js file?

There is another post on this question but I don't find it useful enough so I thought I should ask again. In my compile.js file, I'm taking each smart contract's complied code and put it in a ...
1
vote
1answer
34 views

Who owns the ERC-20 tokens? [closed]

I am creating an Erc-20 token. I want to know whether the token will be owned by the smart contract at the contract's address or by me, the contract-deployer at my address? I want to know this because ...
1
vote
1answer
28 views

What does scope do in the function itself?

Here is one of the functions I am curious about... function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock { require(amount0Out > 0 || amount1Out > 0, '...
1
vote
2answers
29 views

what's the difference between call and just using function?

Let's say I have a contract called contractA. It has the function: function bla(address test) { // way 1. test.call(abi.encodeWithSignature("first4bytes", arg1, arg2)) // way 2. ...
1
vote
2answers
41 views

Unable to Deploy/Migrate to Mainnet via Truffle/Infura

On 12/26/2020 I successfully compiled, migrated and tested on Ropsten via Truffle the following contract https://github.com/estudios-amazonia/FilmVault/blob/main/contracts/FVP_Token.sol. See Ropsten ...
0
votes
1answer
17 views

difference between contract creation in web3 and in solidity

I created a contract named Pepito by calling new in web3: import Pepito from "./contracts_abi/Pepito.json"; const instance = new web3.eth.Contract( Pepito.abi, address,...
0
votes
0answers
23 views

Range error : Maximum call stack size exceeded

I am trying to deploy my contract written in solidity on a test network (Rinkeyby),But when i run the command "node deploy.js" i get the mentioned error in the title of this article which is ...
0
votes
0answers
14 views

Error at calling the memory function

I am using an remix ide for the smart contract development, at the time of compilation of the below code I am facing the error of expected primary expression. Could anyone help me out with this ...
0
votes
1answer
34 views

Unable to interact with a contract on Kovan network on Remix IDE

I am working on a project and I have successfully deployed a smart contract on Kovan test network, but for some reason, I am not able to interact with it in JS code. So, now I want to access it ...
0
votes
1answer
29 views

Deploy basic proxy with arguments

https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol#L32 contains a code to deploy a basic proxy. This code misses a way to pass data to the proxied contract to init it. ...
1
vote
1answer
29 views

how to see contract that only has bytecode

I am looking at this contract - https://etherscan.io/address/0xf8681dad1ce4f1f414fb07fc07f81a3a82e91d8f#code but it turns out that there's only ByteCode and if I decompile it, the code it gives me is ...
0
votes
1answer
22 views

when do smart contract wallets need to sign transaction by themselves?

Do smart contract wallets ever store priv/pub keys or something ? Of course, It would be then seen on the blockchain if it did, but I am asking this because somewhere, I've read that sometimes smart ...
0
votes
0answers
13 views

wallet and smart contract connection

I am just here to make sure that i understand what smart contract wallet and what wallet means. These 2 guesses of mine are highly related so what my question is simple. Am I right about assuming the ...
1
vote
1answer
12 views

does selfdestruct clear/remove data?

I want to know if calling selfdestruct clears/removes data from blockchain or it still remains there. Looking at this link, CLICK HERE it says that data doesn't get removed. (first answer) Looking at ...
0
votes
0answers
15 views

parity hack - how does this work?

I am looking at the following contract https://eips.ethereum.org/EIPS/eip-1822#erc-20-token Look at the following line : Ensures no one can manipulate the Logic Contract. IMPORTANT: I am going to ...
0
votes
1answer
13 views

Factory Pattern Migration With Truffle

have a standard factory pattern for my contract and I am trying to get it up and running using Truffle Migrations. In my factory truffle migration script I have await deployer.deploy(ContractFactory); ...
0
votes
0answers
11 views

Use new to generate an instance of a sub-contract in a smart contract

When we write a smart contract, we can use the keyword new in the code to generate an instance of a sub-contract. I want to know whether the instance of this sub-contract has an address, and can ...
0
votes
0answers
31 views

store data in any slot

contract test { bytes32 private constant ownerSlot = keccak256("ownerSlot"); constructor(address _implementation) public { bytes32 s = ownerSlot; assembly { ...
0
votes
0answers
11 views

estimateGas - how does it work when there's an internal call?

I've read the following: The catch about gas estimation is that the node will try out your tx with different gas values, and return the lowest one for which your tx doesn't fail. But it only looks at ...
1
vote
1answer
17 views

bignumber in solidity - returned values

Let's say that Ethereum solidity returns a number from one of its functions and I get that into Javascript. Now ,because I write tests in my js application, I have to check if the returned value is ...
0
votes
1answer
16 views

solidity - check bignumber returned from solidity

I am using truffle, but that shouldn't make any difference here... When using contract's transfer mehtod, I want to pass a parameter - 1000000000000000000000000, but since this is too big, it results ...
0
votes
2answers
45 views

delegate call - msg.sender wrong value

pragma solidity >=0.4.22 <0.7.0; contract D { uint public n; address public sender; function delegatecallSetN(address _e, uint _n) public { _e.delegatecall(abi.encode(bytes4(keccak256(...
0
votes
1answer
28 views

ethereum - call and delegatecall not working

pragma solidity >=0.4.22 <0.7.0; contract D { uint public n; address public sender; function callSetN(address _e, uint256 _n) public { _e.call(abi.encode(bytes4(keccak256("setN(...
0
votes
0answers
12 views

what does link mean in truffle?

I saw the following : what does `deploy.link` exactly do in `truffle` I have safe.sol library safe { function safeMultiply(uint256 a, uint256 b) internal pure returns (uint256) { if (a ...
0
votes
1answer
10 views

truffle - should I create migrations files by myself?

I am using truffle. I run truffle compile and I get json files in build/contracts directory. Now, truffle says I should run truffle migrate , but in the migrations folder, I only got ...
0
votes
0answers
11 views

erc20 and tokensale how to use interface

I have ERC20 interface copied from here link - zeppelin Now, I have a contract called ERC20 which looks like this: contract ERC20Token is IERC20 { uint8 public decimals = 18; // other ...
0
votes
1answer
17 views

solidity - allowance delegation - what if the owner spent it already

So userA delegates his tokens to be spent by me to whoever I want. That's great. let's say userA's balance was 200Token. and he delegated 150 Token to me.. Now, userA can still transfer 180Token to ...
0
votes
0answers
10 views

deployment failed

Error: * Deployment Failed * "ERC20TransferLiquidityLock" is an abstract contract or an interface and cannot be deployed. Import abstractions into the '.sol' file that uses them instead of ...

1
2 3 4 5
23