Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 50278

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.

0 votes

How to get "deep" values in javascript?

Ok, apparently you have three problems. The first one is the one you described (fetching ALL referrals from one user's tree of referrals); the second one is knowing if a given user is in that tree (w …
Daniel Portugal's user avatar
1 vote
Accepted

Remix - another transaction execution failed

In Remix, there's a problem with blockhash() when using Javascript VM (https://github.com/ethereum/remix-ide/issues/1794). If you try to deploy this contract in Ropsten, it will not fail. So, the pr …
Daniel Portugal's user avatar
6 votes
Accepted

What is (fallback) method in a contract?

The fallback function is the last one in the contract you posted: function() payable { } From https://solidity.readthedocs.io/en/v0.5.10/contracts.html?#fallback-function: A contract can have …
Daniel Portugal's user avatar
1 vote
2 answers
295 views

SafeMath and user input: it's always possible to overflow/underflow. No way out?

SafeMath doesn't prevent overflow/underflow from user input. Example: function sub(uint8 a, uint8 b) public returns(uint8) { require(b <= a); uint8 c = a - b; return c; } Say the user in …
Daniel Portugal's user avatar
3 votes
Accepted

Mapping Multiple Struct Instances To One Address

goodvibration's answer is correct, but just to expand a bit: When you use mapping(address => Cookie[]) cookie; what you are getting is a multidimensional array, in a way. There's a "list" of addresse …
Daniel Portugal's user avatar
11 votes
Accepted

How to compare two bytes32?

A comparison between two bytes32 IS possible in solidity. Consider this simple contract: pragma solidity 0.5.4; contract Test { bytes32 public constant bytes32_ = "Hello World!" …
Daniel Portugal's user avatar
1 vote

Error: gas required exceeds allowance or always failing transaction in Remix using Ropsten n...

The problem is that you're not sending ETH along with the transaction. In Remix, you'll use the field value (just below the field gas limit) to set how much you're sending along with the transaction. …
Daniel Portugal's user avatar
1 vote
Accepted

Problem with running truffle code with node.js

There are two issues with your code. The first one is preventing the contract to be deployed: you must pass the "from" address whenever you send a transaction to the blockchain (as opposed to a call). …
Daniel Portugal's user avatar
1 vote
Accepted

Calling function from existing truffle contract in node.js

I believe you have to await for the contract instance to be returned before calling any of its methods. That's why you're getting undefined. So, you should first do this: _instance = await myPlatfor …
Daniel Portugal's user avatar