Questions tagged [compilation]

For questions regarding contracts compilation.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Error testing call function

I am trying to test the call function using the contracts provided in this link. Attempting on Truffle running Solidity 0.6.12 (I think this is the most recent version) I get the following errors For ...
0
votes
0answers
5 views

Is it possible to compile Yul with truffle?

I have a contract written in Yul that I want to compile. It is not clear to me if this is possible with truffle. Alternatively I tried compiling it in remix and then migrating the artifact file, but ...
0
votes
2answers
38 views

DeclarationError: Undeclared identifier. Did you mean "balances" or "balanceOf"?

I have gone through the similar questions and weirdly, none of them seem to solve this problem. I am creating a simple token contract contract Token { mapping(address => uint) public balances; ...
1
vote
1answer
83 views

How to override when inherited contracts have same method name but slightly different signatures?

I'm inheriting 2 abstract contracts having the same function name but slightly different signature. These are the 2 base contracts: abstract contract Base1 { function foo() internal view virtual ...
0
votes
0answers
16 views

Stack too deep, try removing local variables when using remix [duplicate]

while compiling in remix i get the above error: CompilerError: Stack too deep, try removing local variables. --> work/youkie.sol:1015:80: | 1015 | (uint256 rAmount, uint256 ...
0
votes
0answers
48 views

Build with Library IterableMapping

I'm trying to compile my contract, which uses the IterableMapping library. IterableMapping is being created in the file itself, but even so, apparently an error is being raised, saying that I should ...
0
votes
1answer
79 views

How to compile solidity docs for a particular compiler version

Im trying to run solc --userdoc --devdoc myContract.sol to generate docs. However, the compiler complains that the contract has a different pragma-version. In fact the contract pragma is at ^0.6.0 ...
0
votes
0answers
13 views

Unable to get campaign.json and campaignFactory.json

const path = require('path'); const solc = require('solc'); const fs = require('fs-extra'); const buildPath = path.resolve(__dirname, 'build'); fs.removeSync(buildPath); const campaignPath = path....
0
votes
0answers
38 views

Truffle Compile Fails with Error " Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition"

When running truffle compile in the root directory of my project I get the following error: ParserError: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function ...
0
votes
1answer
58 views

Is it possible to import smart contracts with different compiler versions?

I'm using hardhat to compile my contracts. I am aware that hardhat is good at compiling contracts with different pragma versions, however, the contracts can't compile because they're importing ...
2
votes
0answers
366 views

Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack [duplicate]

I tried to add another parameter to my constructor and I get the following error when compiling with hardtest to test. If I remove one parameter it compiles again, so clearly it's related to the ...
0
votes
1answer
271 views

JSON-RPC Error - Exection Reverted (-32000) / Empty ABI

I am attempting to deploy a BEP20 contract on BSC testnet via Remix. I am using compiler v6.12 and am successfully compiling my Solidity. However, when I deploy the contract, I am receiving the ...
0
votes
0answers
20 views

Error while compiling with nodejs

Im trying to set up the compiler for my project. sol: pragma solidity ^0.4.25; contract Inbox { string public message; function Inbox(string initialMessage) public{ message = ...
0
votes
0answers
11 views

How to locate the source codes by PC for smart contracts

Similar to the debugger module in remix https://remix.ethereum.org/, it can locate the source codes of each PC. Now, I want a tool that can locate the source codes given a PC for large-scale smart ...
1
vote
2answers
55 views

Compile Solidity to assembly keeping a correspondence with the source code

I would like to compile a contract written in Solidity (or even just the part relating to a single method) to study it and understand if I can optimize it. I already managed to get the bytecode as ...
0
votes
2answers
32 views

i am very confused on what's wrong on line 16. balances[msg.sender] = totalSupply;

pragma solidity ^0.8.2; contract Token { mapping(address => uint)public balances; mapping(address => mapping(address => uint))public allowance; int public totalSupply = 10000 * ...
0
votes
1answer
683 views

How to import and compile contracts of different versions solidity

How to import and compile contracts of different versions using solidity in remix? When I import a contract I get this error: ParserError: Source file requires different compiler version (current ...
1
vote
2answers
238 views

What is a nightly build in solidity? [closed]

I have received an error that says so: ParserError: Source file requires different compiler version (current compiler is 0.8.3+commit.8d00100c.Emscripten.clang) - note that nightly builds are ...
1
vote
1answer
110 views

Compilation Error while using ChainLink

I am using Remix IDE for my smart contract development. I am using the following import line import "https://github.com/smartcontractkit/chainlink/blob/develop/evm-contracts/src/v0.6/...
1
vote
1answer
221 views

Remix Solidity Smart Contract Stuck On Compiling State

The 1inch Smart Contract is unable to compile in Remix as it appears to be stuck in the Solidity compiling phase. Expected Create a new 1inch_38211317.sol smart contract file in Remix. Compile the ...
0
votes
1answer
12 views

How to be sure a bytecode is conform to a source code

Let's suppose a company shows me a contract's code source. This code source has been audited and looks fine. I trust this source code and i want to send Ether to this contract. The company tells me ...
0
votes
0answers
340 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
357 views

73: TypeError: "send" and "transfer" are only available for objects of type "address payable"

This is my simple code for following along a tutorial. We are building a Lottery Smart Contract. However, I am failing to transfer the contract's balance to the winner. (see the last line inside of ...
0
votes
0answers
212 views

Slither Error: Invalid compilation: Solidity version not found ['']

I work with Truffle Fluidity to get an analysis on my contract. My contract is in contracts file that Truffle determines that. I preformed all steps that Truffle mentioned in document. I work with ...
0
votes
2answers
384 views

Resolve solidity compiler error

I am trying to create a smart contract and I am using ganache, visual studio code and truffle for that purpose. The versions installed in my windows system are: Truffle v5.1.49, Solidity v0.5.16 (solc-...
2
votes
1answer
292 views

How to test your smart contract against currently existing ones on mainnet locally using Truffle?

Background I am fairly new to smart contracts and am currently experimenting using Ganache and Truffle to test on my local machine. My goal would be to have the smart contract interacting with other ...
1
vote
1answer
117 views

Events declared in library are missed in contract ABI

DYDX contract SoloMargin is firing events like LogTrade, LogSell but they are not provided in ABI. SoloMargin contract: https://etherscan.io/address/0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e#code ...
2
votes
1answer
87 views

How can I use "@" (at sign) syntax with Remix?

I've seen multiple times Solidity contracts, which are using import "@somename/.../SomeContract.sol" syntax. Here's the example: pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; ...
0
votes
1answer
756 views

ParserError: Expected ',' but got ';'

I`m trying compilate this code and getting Parse error pragma solidity ^0.6.0; contract ZooFactory { event NewZoo(uint zooId, string name, uint dna); uint dnaDigits = 24; uint ...
0
votes
1answer
58 views

Does reentrancy attack happens as soon as the balance in storage is modified after the withdrawal?

I just saw something like this: function sub( uint a, uint b ) internal pure returns (uint) { require(b <= a, "SUB_UNDERFLOW"); return a - b; } function withdraw(...
0
votes
1answer
330 views

Why my contract binary does not set?

My project is in Truffle. I programmed a smart contract and want to deploy it with JavaScript. But the following error occurs: Error: Contract error: contract binary not set. Can't deploy new instance....
0
votes
1answer
139 views

How to include constructor arguments in bytecode for smart contract deployment in genesis block?

Please excuse if the title is not perfectly accurate but I had a hard time fitting my problem into 1 question. If you have a better title please feel free to suggest it and i will edit it. I want to "...
0
votes
1answer
51 views

Compiling cpp-ethereum (aleth) sources as a part of my cpp project

I want to use cpp-ethereum aleth smart contracts sources in my altcoin project. My sources can compile with cmake or autotools system. I tried two ways to compile cpp-ethereum with my sources: Using ...
6
votes
0answers
2k views

Stack too deep when compiling inline assembly

I'm running into a YulException: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack. using a smart contract that has this function. I took this ...
1
vote
0answers
1k views

remix compiler just won't end compiling

I've just started my journy with etherium, so now I am trying to get my first script complied. I tried starting with this project https://github.com/san-lee-ai/simple_auction But I could not get the ...
1
vote
0answers
271 views

Contract can't import remote repository locally

I made a compiler script that takes all contracts in folder ./contracts/ and produces a .json for each contract, containing an ABI and Bytecode. This worked fine for a while. However, I added some ...
1
vote
1answer
360 views

Can I deploy smart contract written in an older version of solidity ? If yes how to recognize it in EVM?

If I can compile a smart-contract written in an older version say 0.1.3, can I still deploy it? If I can, is there a way to look at EVM bytecode and tell that this smart contract is written with an ...
6
votes
1answer
1k views

Status of ABIEncoderV2 now

Do you know the current status of ABIEncoderV2? I want to know the current status of ABIEncoderV2 Live projects using ABIEncoderV2 right now Restriction on the normal encoder Risks of using ...
0
votes
1answer
199 views

#pragma compilation Error [duplicate]

pragma solidity ^0.4.0; contract test { event test_value(uint256 indexed value1); uint256 value_test; function test_f() { //value_test processing test_value(value_test)...
1
vote
2answers
84 views

Get values from stack when certain Opcode is called

I am currently trying to use genetic algorithms to automatically generate test cases that for ethereum smart contracts similar to https://ieeexplore.ieee.org/abstract/document/7840029>this paper. In ...
0
votes
2answers
535 views

Error while compiling Solidity code via py-solc

I am getting the following error while attempting to compile Solidity code via py-solc. Is it due to a new update of py-solc? how can I fix it? >>> from . import views File "/home/manzik/...
4
votes
2answers
1k views

How to compile Solidity ^0.5.5 contract with Node.js?

I am terribly new in Solidity and now I try to learn how to compile a contract in Solidity ^0.5.5 (No versions below). I have the contract as follow (UsersContract.sol) pragma solidity ^0.5.5; ...
0
votes
2answers
3k views

Invalid implicit conversion from address to address payable requested

first of all really nice to find this forum, I'm starting coding Solidity. Here the problem I get compiling a template of crowdsale smart contract ExampleTokenCrowdsale.sol, from this tutorial. The ...
2
votes
1answer
28 views

Unexpected behaviour. Huge size increase when adding new SubContract()

I have a contract similar to: contract Contract01 { SubContract _refContract; ... constructor() public { refContract = new SubContract(); } function setSubContractRef(SubContract ...
1
vote
1answer
112 views

how to change approveAndCall() function for upgraded compiler version of solidity 0.5.1 from 0.4.6?

Here is the code snipped which is used when I'am working with compiler version 0.4.6 : function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) ...
0
votes
3answers
1k views

Solidity ,Member"transfer"Not found or not visible after argument dependent lookup in address

pragma solidity ^0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user ...
1
vote
2answers
2k views

Unable to run truffle compile

I want to run truffle compile on my AWS Ubuntu 18.4 server. I'm able to compile the same contracts on my local with no compilation errors but when I tried to run truffle compile on AWS ubuntu server ...
1
vote
0answers
147 views

My code compiles on remix.ethereum.org but not on etherscan.io please help! [closed]

I get this error " ParserError: Function, variable, struct or modifier declaration expected. function transferFrom(address _from, address _to, uint _value) public returns (bool) ^ " everytime ...
1
vote
1answer
64 views

How come npmjs website shows that Truffle latest version is 4.1.14, and that it was published 3 days ago?

According to this page, Truffle latest version is 4.1.14, and it was published 3 days ago. However: I have been using this version for months now. I have noticed this "published 3 days ago" several ...
7
votes
1answer
472 views

When did the Ethereum "free memory pointer" change? (6060... -> 6080...)

I have been digging a bit deeper into the Ethereum bytecode with the specific goal to do contract verification from the source code. I noticed, while doing some tests, that the initial bytes of the ...