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 answers only not deleted user 19510
3 votes
Accepted

How to set multiple unit64 values in a uint256 variable

Your smart contract code is okay, but this is probably simpler: pragma solidity 0.5.7; contract Uncombine { function getVariables(uint256 combined) external pure returns (uint64 variable1, uint64 …
user19510's user avatar
  • 28.1k
2 votes
Accepted

Mapping with iterating uint as identifier - multiple transactions in the same block

No, it doesn't matter whether transactions are in the same block or not. Each transaction is processed on its own, sequentially. The code you propose is fine, though an array may make more sense.
user19510's user avatar
  • 28.1k
2 votes
Accepted

Solidity. Return a Sruct that lives inside an array

You forgot to name your variable. You only gave it a type. Try this: function getStudent(uint id) ... { return (students[id].name, students[id].ethAddress, ...); }
user19510's user avatar
  • 28.1k
0 votes

Create token exchange by defining decimal values

The typical solution is the one you alluded to. Use a big multiplier. E.g. instead of storing 1, 1.5, and 1.75 store 1000, 1500, and 1750. More typical in smart contracts, because ether natively uses …
user19510's user avatar
  • 28.1k