Questions tagged [solidity-0.5.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.5.0 is a specific version that includes a number of changes to the language and introduce new features.

34 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
30 views

How Can You Map a Struct Twice With Different Keys?

I have a struct mapped with an address as the key. I want to iterate through all values of that mapping with another key value, in this case a nonce that I generate in the contract. Is this possible? ...
1
vote
1answer
50 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 { ...
1
vote
0answers
54 views

How to call the super contract function where msg.sender should be same in solidity?

I am trying to call contract A.fun_A() via Contract C contract A{ function fun_A(address tenant, uint itemId){ //Here the msg.sender should be msg.sender in C require(msg.sender == ...
1
vote
1answer
37 views

Receiving error while getting state variable value after using selfdestruct method “Error: Returned values aren't valid, did it run Out of Gas?”

I am using selfdestruct method and passing the payable address to it but receiving the following error when trying to get the value of a state variable : "Error: Returned values aren't valid, did it ...
1
vote
0answers
41 views

transfer(amount) failed even when it is not a contract

address payable receiver; receiver.transfer(amount); The receiver is NOT an contract, and the amount is only 0.4 ether, the contract is holding sufficient ether in its balance. I understood that ...
1
vote
1answer
251 views

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error?

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error in solidity while compiling through truffle ? How to fix it ? Using solidity compiler version - 0.5.9
1
vote
1answer
50 views

Direct and separate funds into two different payable functions

Basically I have this code where I'm trying to divide a specific amount of ether into two different function calls within the contract. function singleTransaction(arg1) payable { require(msg.value ...
1
vote
1answer
333 views

Error when testing the contract

ApprovalContract.sol pragma solidity ^0.5.1; contract ApprovalContract{ address public sender; address payable public reciever; address public constant approver=...
1
vote
1answer
59 views

solidity 0.4.25 to 0.5.0

when I used 0.4.25, it compiles successfully. function callByFun(address addr)returns (bool){ bytes4 methodId = bytes4(keccak256("increaseAge(string,uint256)")); return addr.call(methodId,"...
1
vote
2answers
50 views

Why is solidity throwing “Note: The constructor should be payable if you send value. ”, when clearly the issue is elsewhere?

I'm writing a contract on Remix that is able to deploy and track child contracts. Here are the 2 contracts: pragma solidity ^0.5.0; Contract Factory contract ContractFactory{ ChildContract[] ...
1
vote
1answer
28 views

Use Values Returned from One Function in Another

need a little help if you can spare the time. Making a little card game where people can collect "warrior" cards. We'll have an initial 12 master "cards" that supply the initial traits for the ...
0
votes
0answers
18 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(...
0
votes
0answers
45 views

Solidity 0.5.0, issue related to transfer function

I am using the transfer function to transfer some balance to an address based on reward scenario. Now the issue i get is, when comparing the balance of the address as well as contract before and after ...
0
votes
0answers
21 views

Negative integer function

I have the following problem, one of my function has a variable where the uint can be negative but I don't know of that before the user enter in the form the integer. How do I settle this problem ? ...
0
votes
1answer
94 views

Warning! Error encountered during contract execution [execution reverted]

I have an ERC20 Mintable+Burnable Token created on solidity 6.11 and a sale contract on solidity 5.0 I am getting error when i send ETH to the sale contract. https://rinkeby.etherscan.io/tx/...
0
votes
2answers
20 views

Couldn't understand the logic behind code for mulitdeed payout contract

While searching on the web I came across this page the user has created multiple examples of solidity smart contract On multiple payout deed smart contract I can't understand this line duePayouts = ...
0
votes
0answers
32 views

Polymorphism in Solidity

I understand that Solidity supports contract polymorphism, but what pattern would one use to create abstract data types for use in derived contracts? Motivating example: Say I have an abstract Storage ...
0
votes
0answers
42 views

Truffle + Infura Mainnet deploy. Transactions never get mined, timing out after 750 seconds

The contract deploys on Rinkeby without a hitch, but when it comes to mainnet it is erroring out strangely. Infura's HTTP endpoint was giving me Invalid JSON RPC RESPONSE "", so I decided to ...
0
votes
0answers
17 views

How to make my contract balance as private in Ethereum?

Suppose there are two contracts, A and B. Obviously, balance of A is public and B can read it with address_of_A.balance. Is there a way to make balance of A as a private data and B can't read it with ...
0
votes
1answer
40 views

delegatecall method - calling context is not being set

We have an issue with delegatecall method. We want to call contract C2 from C1 (which is supposed to be a pass through contract for the user wallet). When we are calling C2 via C1 even using ...
0
votes
0answers
42 views

Transaction halted with a RUNTIME ERROR

while debugging I encountered this error: There was no revert message. This may be due to an in intentional halting expression, such as assert(), revert(), or require(), or could be due to an ...
0
votes
1answer
183 views

Openzeppelin Crowdsale

Ok so Ive found Openzeppelin a slightly easier Code to use, it explains better than Solidity does. But now my problem is the Math bit. Im no mathematician neither and cannot get my head around how it ...
0
votes
1answer
134 views

Factory contract to clone existing contracts

I am researching about Factory contract to clone existing contracts, First is the implementation present at https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol. I don't ...
0
votes
0answers
55 views

Deploy ERC725 Identity with ERC735 Claims

I am using ERC725v1 and ERC735 Interfaces to add a contract which can deploy an ERC725 based Identity contract that can hold an Identity key and further Add Claims from that Identity for the ...
0
votes
0answers
33 views

Version Compatibility Issues Solidity v0.4 to 0.5 | Identity Contracts ERC 725 | abi.encodePacked not working

This is in reference to ERC 725 Identity Contracts. I am updating the contract to version 0.5. The issue arise in a specific function where it requires a single argument to the call method which I ...
0
votes
1answer
43 views

“Migrations” exceeded the block limit

I didn't have any problem using solc 0.5.0 (geth 1.9.3), but facing this problem after upgraded to 0.5.12 (geth 1.9.9). After doing some research, I believe it is because of the changes to the ...
0
votes
0answers
38 views

Comparison of 2 child-contract-values in factory-contract

in my solidity code I create a tracking-contract and auction-contracts out of a factory-contract. The last function 'a4_Payment' of the auction-contract should be triggered out of the master-contract ...
0
votes
0answers
30 views

Can a factory-contract access/read/modify variables in generated child-contracts?

at the moment I am experimenting with the factory/child-logic in solidity. With my factory contract I am able to create child contracts in which an auction is executed. Now I want to return a variable ...
0
votes
1answer
38 views

Combine BytesX and BytesY to create BytesZ?

I am working on a Solidity Smart Contract (^0.5.10) where I want to return an array of Ratings elements. struct Ratings { address restaurant uint8 score }; Since returning Rating[], string[]...
0
votes
1answer
359 views

How to hash multiple values including array keccak256 Solidity v5.0.x and web3 'Autodetection of array types is not supported.'

How can I receive the same hash in solidity and web3? Multiple values where one is a multi dimensional array. Solidity v0.5.x: pragma solidity 0.5.6; pragma experimental ABIEncoderV2; contract Hash{...
0
votes
1answer
149 views

passing variables between different contract by solidity (0.5.0+ version)

I writed ERC20 contract and ICO contract for a test , but I meet a lot problem with compile problem. My ERC20 contract have own constructor but,I also need a ICO contract(a control)for passing ...
0
votes
1answer
1k views

Truffle console error “Error: Returned error: VM Exception while processing transaction: revert”

I compiled and migrated my solidity codes of erc20 token to development networks on truffle, and use it on truffle console. truffle(development)> let instance = await XToken.deployed() truffle(...
0
votes
0answers
431 views

Truffle migrate not working with 2_deploy_contracts.js

I have made a sample contract using Truffle's pet-shop. I have also added the 2_deploy_contracts.js file. I have changed the solidity version and also the constructor() public {} to comply with the ...
-1
votes
1answer
142 views

How and when should I use a Ethereum smart contract in document verification process?

First, a student applies for a certificate in his/her University . The University creates his degree certificate . Now , how do I write a smart contract in Solidity so that anyone in blockchain can ...