Questions tagged [solidity]

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
11 views

function overriding is quite working when called with web3.js

function getDetails(address publicKey) public view returns (Organization memory) { return s.getOrg(publicKey); } function getDetails(string calldata orgID) external view returns (Organization ...
0
votes
1answer
12 views

How is Ethereum Virtual Machine (EVM) isolated (sandboxed)?

I always had this question in mind: What are the used technologies, in order to achieve the isolation of the EVM? does it just run as an isolated process in its own namespaces using the linux feature ...
0
votes
2answers
194 views

How to communicate with a deployed token?

Using Truffle, I am trying to deploy the following contract: pragma solidity ^0.4.13; contract ERC20Events { event Approval(address indexed src, address indexed guy, uint wad); event ...
0
votes
1answer
229 views

how to call java method via solidity contract

I have my solidity contract //solidity contract pragma solidity ^0.4.7; contract SimpleStorage { uint public storedData; function SimpleStorage(uint initialValue) { ...
4
votes
1answer
379 views

Solidity link to external library address - use Lib for uint256 breaks

I am hoping to link my contract to an external library by defining 1) an interface contract that defines the library functions and 2) the main contract that refers to the actual library address. My ...
1
vote
1answer
25 views

Getting an error when (attempting to) using Web3js

I'm trying to connect a smart contract to a very simply front end that has html/css/js. I keep getting an error when trying to use web3 to connect - I have the code below but the terminal is giving ...
0
votes
0answers
14 views

how to deploy dynamically contracts? [on hold]

I am developing dapp application where seller uploads item and buyer purchase it. I am stuck on creating a smart contract. my goal is to create per contract for one seller uploads item. if seller ...
0
votes
1answer
5 views

How can I debug a my Solidity smart contract with a GUI?

Is there any way to debug a Solidity smart contract with a GUI, like remix? How can I do it for both testnets and mainnet?
0
votes
1answer
14 views

What are the ways to call a smart contract function during development?

What are the ways to call a smart contract function during development using Truffle simulated VM with a GUI interface (like Remix or EtherScan offer)? I know I could use CLI options like Truffle ...
0
votes
1answer
294 views

Contract not using Upgraded Proxy Contracts

There's 2 contracts A and B, A imports B, where B is a library that can be upgraded. To achieve this, I tried replacing B with a proxy contract and a delegate contract. We now have contracts Foo, ...
0
votes
1answer
20 views

Loading modified contracts keeping the same super class

I am trying to implement upgrade of contracts. One pattern by [1] is to have a layer to resolve the actual address of a contract. I implemented that adding the Pausable manipulation. My idea was to ...
1
vote
1answer
271 views

Is it possible to send ERC20 tokens to a smart contract that is written to accept payments..?

I have ERC20 compatible token that is already deployed in the ethereum main-net. I have a requirement to accept these tokens as payment, And this is going to be a new contract, The below are my doubts....
0
votes
1answer
178 views

How can I show on web3j a list of all the instructors added on my blockchain?

I need to show on an html a list of all the instructors that are set up on the list pragma solidity ^0.4.18; contract Owned { address owner; function Owned() public { owner = msg.sender; } ...
0
votes
1answer
47 views

Supply amount exceed total supply! Why the quantity supply shown 1.00 E+59

the quantity amount over the total supply, shown 1E +59 Airdrop solidity code maybe got something problem, does someone had idea?? Can't check for token Holder, "Sorry, We Are Unable To Generate The ...
0
votes
0answers
10 views

How to find which transaction cleared a specific address into a specific contract?

I have a contract with contains the following solidity code mapping (address => mapping (bytes32)) public sealedBids; But I failed to find in the solidity code which part can clear it. As result,...
0
votes
1answer
222 views

How to access storage areas when libraries are used?

I am testing storage areas to see exactly the efficiency aspects of this and I have trouble finding the storage on the disk for the contract/library combination. Here is the code - pragma solidity ^...
2
votes
2answers
308 views

How do I use filter EVM log events by an indexed field in web3j?

I've looked through the documentation, but there doesn't seem to be this scenario listed. What I want to do is filter the Ethereum event log of a specific contract by an indexed field with Web3j. ...
1
vote
1answer
209 views

ERC20 contract reverted

Hello everybody i'v deployed a erc20 contract on the main network all work fine but when i send ether to the contract adress i have this error : Warning! Error encountered during contract execution [...
0
votes
1answer
10 views

return array of strings

how do I return an array of strings? This is my code: contract PlanetEarthContract { string[7] continents; constructor() public { continents = ["North America", "South America", "...
0
votes
1answer
12 views

Solidity. Return a Sruct that lives inside an array

I am not sure how to return a struct that is inside an array of structs. This is my code: contract StudentsInfoTracker{ Student[] students; struct Student{ string name; ...
1
vote
1answer
207 views

creating multi signature address in solidity

How can I create an array of multi-signature address (2-of-2 P2SH multisig, keeping one account on all the multi-signature account constant) in web3js or solidity so that my custom token can be ...
0
votes
1answer
40 views

TypeError: Cannot read property 'nodes' of undefined

I'm new to ethereum, and I'm trying to test the depositToken function of etherdelta on linux, which version is 0.4.9, and the token I use is vixcore which version is 0.4.24, and I got this error when ...
0
votes
0answers
13 views

Solidity. How to add an address to a mapping

I have this: contract Diary { string[] private facts; mapping (address => bool) approvedAddresses; address owner; constructor() public { owner = msg.sender; ...
1
vote
1answer
221 views

Convert future date to UTC

Is there an easy way to convert a set time to UTC and stored in a smart contract? I know we can set dates relative to the current timestamp such as "now + 5 days". Though if we wanted to set a ...
2
votes
1answer
215 views

error: invalid opcode using modifier

Im getting the following error when trying to run my js test file using truffle: Error: VM Exception while executing eth_call: invalid opcode The js test file is the following: var DebitService = ...
1
vote
1answer
214 views

Truffle test case to unit test withdrawal pattern

How can I test the withdraw() function in a truffle javascript test case for the below contract? The problem is, If I use the msg.sender from the same contract, the before and after balance will be ...
0
votes
0answers
15 views

One Proxy delegate contract to ten another proxy contracts

I'm trying to figure out why this code reverts. I need to make 10 bottles. This is how I do this: deploy Logic contract deploy 10 Proxy contracts call "upgrade" at each Proxy and pass Logic address ...
0
votes
1answer
18 views

Error returning array in function

I wanted to do a get() to return some contract information, including an array, but when I put it gives this error: browser/leilaoSimples.sol:34:9: TypeError: Data location must be "memory" for ...
0
votes
1answer
200 views

Error while calling function in smart contract using nodejs?

I have deployed a contract in private blockchain using mist wallet. When I try to call the function in the smart contract using web3 api it through the below error /home/karthikeyan/Desktop/n2/...
0
votes
0answers
19 views

Fetch ETH USD Rate from past using Oracle

Is it possible to fetch the USD rate of ETH at a specific time in the past to a smart contract from an external API using an oracle? i.e. I have a function which tracks whether now > start + 10 ...
1
vote
1answer
114 views

How to execute transactions of my Ethereum contract deployed on Rinkeby test client using REST apis?

I would like to build a UI on top of my ethereum contract and how can I get a use a REST API to execute transactions in my contract ? which one of Rinkeby etherscan API could be used ?
0
votes
0answers
19 views

geth issues while running command

I am running the following command with added parameter miner.gastarget on a linux server since we had issues while developing, and have to increase gas limit sudo geth --ipcpath "/home/...
10
votes
3answers
17k views

How to convert BigNumber to Number in Truffle framework?

I have written an ERC20 token contract and deployed it in test network using truffle framework. When I check the token balance for an account using web3 it was giving the result in BigNumber when I ...
0
votes
2answers
35 views

ParserError: Expected pragma, import directive or contract /interface/library definition

In an attempt to compile my ABI and verify my contract, I am getting the following warning: "ParserError: Expected pragma, import directive or contract /interface/library definition" on the first line ...
0
votes
1answer
25 views

Can I use import {address [ ] } from 'filename' to pass a address array to another smart contract's function?

In my PersonalInfo.sol file I want to pass address array Users(maybe by function SendUserArray, but I don't know how...) to another contract System.sol file. Is it possible to use import {Users} from ...
1
vote
2answers
337 views

Smart Contract - Update implementation using a Relay with delegateCall

I know that smart contracts are supposed to be immutable and that's the whole point, but to expect someone to implement a logic that never changes (no upgrade or no bugs) from day 1 is also ...
2
votes
2answers
46 views

Drizzle and Contract Instances

I am currently developing a dApp with Drizzle on top of ReactJS. My project consists of, basically, 8 .sol files. 4 of them are just abstract contracts that include the functions, structs etc. for ...
0
votes
2answers
50 views

find the bytecode of a contract during compilation

Is there a solution to recover the complete bytecode (init + runtime) of a contract imported in solidity. For example "bytes code = getBytecode (Escrow.sol)" and this would be replaced by bytecode ...
2
votes
1answer
210 views

Contract creating other contract doesn't show resulting transaction details on etherescan

Looking for help with a successful transaction not showing the details on etherescan. Having a deployed factory contract like so (simplified): contract EntityFactory { event EntityCreated(...
0
votes
1answer
16 views

Cannot mint ERC223 token

Hello I have a simple implementation for a ERC223 Token. I use this repository: ERC223-token-standard Here is my contract Code: pragma solidity ^0.5.8; import "./ERC223-token-standard-development/...
2
votes
1answer
377 views

web3.py constructor(address type)

I tried to deploy the contract on my testrpc, but I get error when my constructor using "address" type. Here is my python code: import json import web3 from solc import compile_source from web3....
0
votes
1answer
25 views

Gas optimisation for my art experiment spacecans.com

so I was microdosing some research chems and the thought came to me that I need to do some artsy blockchain stuff for once. It's two tin cans floating in space that you can advertise your so-called ...
1
vote
2answers
460 views

function () public payable modifier can trigger actions when sending tokens or only works when sending ether?

Modifier payable triggers an action when an address sends ether to a contract. For example: function () public payable { require(msg.data.length == 0); DoSomething(); } Is this ...
2
votes
1answer
218 views

Geth Sync Problems | Rinkeby, Ropsten | Deploy contracts

Get Geth to sync --> Rinkeby test network. For the love of god I just want to deploy a contract. I have deployed it to Ganache-cli, GUI, remixIDE, deployed with truffle/Infuria.io...I keep failing to ...
0
votes
1answer
20 views

Warning: Unused local variable: bool

contract Puzzle { address payable public owner ; bool public locked ; uint public reward ; bytes32 public diff ; bytes public solution ; /*constructor () payable public {...
0
votes
1answer
10 views

analyzing transaction cost for a smart contract

Given a smart contract, How do I figure out the total amount of gas used? Say for example a smart contract which has a parameterized constructor which stores 5 variables which are address type ...
0
votes
3answers
458 views

Access to a child contract method

my question is simple and I want to know if there is a possibility to achieve something like this. I have two contracts, one inherit from the other; I want to access to a method of the child contract ...
0
votes
1answer
381 views

How to see event name in etherscan.io transaction event log?

In etherscan.io, I want to be able to see the event name (signature) in the transaction page event log, like here. Currently, I don't see it here. I'll note that the transaction is indeed sent to a ...
1
vote
1answer
252 views

Error: StartCoinCrowdsale contract constructor expected 5 arguments, received 6

This is my contract code. contract StartCoinCrowdsale is TimedCrowdsale, MintedCrowdsale, CappedCrowdsale, FinalizableCrowdsale { //100000000000 uint256 public constant TOTAL_SHARE = 100; ...
0
votes
2answers
102 views

Remove array specific value

In a array that the values are never repeated. Is there a function/library or something similar that you give the value to remove. And the function the empty space in the array?? function remove(uint ...