Questions tagged [solidity-0.6.x]

Solidity is a contract-oriented, high-level language whose syntax is similar to that of JavaScript and it is designed for writing smart contracts in Ethereum to run on the EVM. Solidity is statically typed, supports inheritance, libraries and complex user-defined types among other features. Solidity version 0.6.0 is a specific version that includes a number of changes to the language and introduce new features.

32 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
0 answers
185 views

Include library function without function body

Using solc 0.5.0 it's possible to compile a contract that has a library function implemented with no body. For example: library Hasher { function MiMCSponge(uint256 in_xL, uint256 in_xR) external ...
GeraldHost's user avatar
3 votes
0 answers
1k views

Passing constructor arguments from child contract to parent contract

The ERC721 standard contract requires a token name and symbol in its constructor. I have inheritance pattern that looks likes Contract A is B and Contract B is ERC721. If I want to set my token name ...
Pm Rivière's user avatar
2 votes
0 answers
74 views

How to really encode dynamicall length array of structs in Solidity ? Or how to use the Muliplex Feature of 0x?

I need to use the Multiplex Feature of 0x in order to perform a specific trade that perform a UniswapV3 call followed by a _FillOTCorder using the SelfBalance feature of the the Multiplex Feature. As ...
user2284570's user avatar
  • 1,008
2 votes
0 answers
119 views

What's the purpose of single-variable expressions per line?

When doing the ethernaut exercises, I've stumbled upon some expressions that I don't know how to make sense of, like this; or _amount;. I don't understand what's their purpose since to me it doesn't ...
Piotr's user avatar
  • 21
2 votes
0 answers
121 views

ParserError: Expected '{' but got reserved keyword 'override' ) external override returns (bool) { ^------^

Can someone fix the code problem below? I compile in remix.ethereum.org , it show ParserError: Expected ';' but got '}' } external override The code: pragma solidity 0.5.8; /** Ropsten instances:...
funny cartoon's user avatar
2 votes
0 answers
520 views

How to get event from geth ethereum node using web3.js

I have created a simple contract where I am trying to write a value to a state variable in solidity smart contract, and emit that written value. I am using Truffle v5.1.28 (core: 5.1.28) Solidity - 0....
Moh's user avatar
  • 21
2 votes
0 answers
1k views

When to use "memory" and "storage" keyword in solidity 0.6.0?

From what I've learned and noticed. Please add more point and rectify me if I'm wrong. Use of memory keyword 1)When initialising/declaring Struct, Array , and mapping. 2)In the parameters of functions ...
Haseeb Saeed's user avatar
2 votes
1 answer
1k views

API node js with call and send to a contract without metamask

I am new in Solidity. I'm trying to create a API in node js, which can be use without a navigator like chrome with MetaMask. I would like to test it with postman. But i have some problems with web to ...
Louis's user avatar
  • 21
1 vote
0 answers
328 views

Two metadata hashes at the end of the bytecoe

doing my own research i saw that the metadata hash is added to the end of the bytecode and i can extract and decode it with cbor. I know that we can identify them by different ways, in this case with ...
Víctor Hernández's user avatar
1 vote
0 answers
633 views

How to send ether to call fallback function

Im currently working on a project which can create a uniswap liquidity pool on the fallback function however the transaction is not even broadcasted to the blockchain when trying to send some ETH via ...
Felix's user avatar
  • 11
1 vote
0 answers
76 views

Getting the same hashes on the web3 and Solidity side

How can I repeat this operation on web3.js and get the same hash function test(uint a, uint b) pure public returns (bytes32) { bytes32 hash = keccak256(abi.encodePacked(uint40(a), b); return ...
Dmytro Slutskyi's user avatar
1 vote
1 answer
2k views

swapTokensForEth transaction fail when called within a contract in a swap

I have this token test contract: The contract has a transaction tax of 1%. The transaction fee is converted to (myContractToken to bnb) and sent to a wallet. It is used the balance of the token that ...
user2983041's user avatar
1 vote
0 answers
150 views

TypeError: Library functions must be implemented if declared for solc compiler version ^0.6.0 library implementation

Suppose I have the following code: // SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; library SomeLib { function add(uint256 a, uint256 b) public returns(uint256); } contract ...
user76333's user avatar
  • 167
1 vote
0 answers
54 views

What's the difference between this.function() and function() in recursion?

I stumbled across some odd behavior that I can't explain regarding recursive functions in Solidity. As a note, I have attempted to run this on ganache in case it is actually ganache that is throwing ...
Shiri's user avatar
  • 786
1 vote
1 answer
1k views

Using inherited constructor in Solidity >=0.5.0

I want to use a contract inherit from another contract and use the parent constructor after using another commands in inherited constructor. So I wrote: pragma solidity ^0.5.10; contract A { ...
Alireza Zojaji's user avatar
1 vote
0 answers
382 views

Remix contract balance transfers Failing (Metamask / JS VM)

There is an issue with my smart contract not transferring any funds to any other address on the connected ganache instance. Regardless if I choose "JavaScript VM" or connect to my Remix, the ...
dankir's user avatar
  • 11
0 votes
0 answers
84 views

Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545

Acutally I create a smart contract that the user create an auctions for things, so whenever some buyer come in website and see the acutions if he want to buy then he will create an offer. Same as if ...
Yasir Saeed's user avatar
0 votes
0 answers
28 views

Reverted Transaction For Any Adress (require not functioning as intended) in Solidity

I'm in the process of making a decentralized polling web app (relatively new to smart contract development). The idea is that a user connects their wallet via MetaMask, creates a poll or votes on a ...
user20295118's user avatar
0 votes
1 answer
33 views

Looking for data in Smart contract

// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; contract Storage { struct People { uint256 personId; string vorname; string nachname; uint256 birthdate; ...
maxver's user avatar
  • 1
0 votes
0 answers
583 views

Return JSON from view function

I'm trying to find the "best practice" to return a JSON formatted string from a view function. Basically, I plan to loop through a set of data stored in contract state, build it all into a ...
pdmoerman's user avatar
  • 131
0 votes
1 answer
45 views

Alter data in a struct using solidity

I am trying to create a students record using remix I am trying to replace data from an already stored struct. How can I do that? Below is my implementation untill now. contract StudentContract { ...
Andrei Cristodorescu's user avatar
0 votes
1 answer
311 views

TypeError: No matching declaration found after argument-dependent lookup

How do I fix this? TypeError: No matching declaration found after argument-dependent lookup. require(instance.execfunct(address(this),2100,gaslimit,hex"00")); ^-----^ Candidate: function ...
garm's user avatar
  • 13
0 votes
0 answers
184 views

ParserError: Expected ';' but got '{'"?

ParserError: Expected ';' but got '{' aion.ScheduleCall{value:callCost}( block.timestamp + 1 minutes, address(this), 0, 200000, 1e9, data, true); pragma solidity ^0.6.0; contract Aion2 { using ...
garm's user avatar
  • 13
0 votes
1 answer
45 views

I read the description, but I don't understand it. Thank you for every day

ParserError: Expected type name function execfunct pragma solidity ^0.6.05; abstract contract AionClient is Aion, Context, Ownable{ using SafeMath for uint256; address private AionAddress; ...
garm's user avatar
  • 13
0 votes
1 answer
53 views

Error Occurred while changing compiler version

below is my contract with compiler version >=0.6.0. when I change the compiler version ^0.8.2 I am getting error as: Return argument type address is not implicitly convertible to expected type (...
Prabhakaran Mathiyalagan's user avatar
0 votes
0 answers
95 views

amount of gas used in receive and fallback functions in truffle tests

I have a contract that is written in solidity ^0.6.4 and has a simple implementation of reverting funds when someone directly transfers some eth or calls an unhandled function. Now it appears to be ...
Mehrad's user avatar
  • 1
0 votes
0 answers
33 views

Issuing 1-1 eth for token problem

pragma solidity 0.6.6; // import "./XYZToken.sol"; contract Vault { mapping(address => uint256) balanceOf; mapping(address => bool) hasDepositedEther; mapping(...
Lucus's user avatar
  • 107
0 votes
2 answers
858 views

Convert a string in scientific notation to a number

my smart contract uses an Oracle to retrieve the price. The price is returned as a string in scientific notation, for example, "3e-8". How I can convert this to number (uint)? The token has ...
EtherPaul's user avatar
  • 256
0 votes
1 answer
543 views

Deleting an array in storage (>= 0.6.0)

I need to add elements to a resizable myArray and then delete the myArray. I don't know what the length of myArray will be before the loop, and it's not possible to resize a memory array; that leaves ...
slider's user avatar
  • 264
0 votes
0 answers
286 views

Weird error during buy tokens with eth on ropsten and other testnets

I get this error when executing swap token for ether on arb detection. Error Message: execution reverted (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves()...
gbenroscience's user avatar
0 votes
1 answer
124 views

Function withdrawReward "The transaction has been reverted to the initial state"

Dear colleagues of the Ethereum environment, I'm learning to code Solidity in a intermediate level. Trying to adapt existing old 0.4.19 contract for a experiment of crypto-investment fund. I have a ...
Ecofintech's user avatar
0 votes
0 answers
92 views

Can I check whether any deployed contract has implemented some particular interface or not?

My concern is whether I can do interface detection with my own interface,,, Like suppose, i have implemented some interface say loyalty interface in my one contract and I have deployed that contract ,...
Pardeep Thakur's user avatar