Ethereum

Push to an array created inside a function

I want to create a temporary array that is returned from a function. I declare it in the function and use the memory tag but I am unable to push to it. function getAllLandForSale() external returns(uint256[]){ uint[] memory propertiesForSaleArray; // Get the total number of properties created uint256 totalNumberOfProperties = ....

Sophia Sophia: yesterday

Ethereum

Cyclic dependency in smart contracts?

How can we manage cyclic dependency in solidity smart contracts? for example: contact A { B b = B(); } contract B { A a = A() } ....

Ava Ava: yesterday

Ethereum

Can not see my Envion tokens on MEW

I tried everything in order to see my Envion tokens on MEW myetherwallet, I tried contract adress, symbol, decimals ... I also tried with Envion private key and mnemonic phrase ... I bought Envion tokens with Bitcoins and maybe this is the problem ... I can only see my tokens ....

William William: yesterday

Ethereum

Why are integers returning as hex?

I am implementing a simple smart contract in Solidity 0.5.9. One of the functions is called getSummary() which basically returns a summarized version of a vote: function getSummary() public view returns (uint, uint, uint, address, bool) { return ( reward, choices.length, votersCount, manager, pollActive ); } I test this in ....

Olivia Olivia: yesterday

Ethereum

Why web3.version.api shows undefined for web3 1.0 and not undefined for web3 0.20.3?

I'm trying to use MetaMask and web3js to talk to my smart contract. Below are my test codes. This is without defining a web3 js file and I get the result "0.20.3" at console. <script> window.addEventListener("load", function() { // Checking if Web3 has been injected by the browser (Mist/MetaMask) if ....

Henry Henry: yesterday

Ethereum

Solidity Contracts Callback

I have two contracts, an active contract A is interacting with the external world and many passive contracts P (dynamically added) are designed to trigger some functions when in contract A certain conditions are met. Therefore contract A is supposed to call a callback function of each of P contracts; ....

William William: yesterday

Ethereum

Connecting with existing ganache core server

I have a ganache-core server running at port 18545 (part of an npm app) How can I attach to it and see the transactions/blocks in that. I tried running ganache GUI and setting port number as 18545 in settings. But it doesn't show any transactions when actions are performed in ....

Lucas Lucas: yesterday

Ethereum

Confused by the way to construct an abstract contract

Confused by an example of the doc (https://docs.soliditylang.org/en/v0.8.3/contracts.html#inheritance) Codes like below // These abstract contracts are only provided to make the // interface known to the compiler. Note the function // without body. If a contract does not implement all // functions it can only be used as an interface. ....

Benjamin Benjamin: yesterday

Ethereum

How to compute SHA-3 of an array of numbers in Javascript?

The documentation (http://solidity.readthedocs.io/en/latest/units-and-global-variables.html) says that sha3 calculates the hash of the tightly packed arguments. Numbers seem to be converted to ASCII chars. Consider using sha3(values) in Solidity with the type int8 values, and the Javascript array let values = ;, how can I calculate the web3.sha3(...) hash in Javascript to ....

James James: yesterday

Ethereum

How to make transaction using private key and address using web3j

I have a private key and address . Is it possible to make transaction with these parameter using web3j. ....

Ava Ava: yesterday