Skip to content

Miscellanous - differences #10

Open
@ghost

Description

Dima recommends rewriting this part to fit our VM specs

Virtual Machine parts to test:

  1. Layout of State Variables in Storage
    https://github.com/arrayio/array-io-solidity/blob/master/miscellaneous.rst#layout-of-state-variables-in-storage
    a) > ...are packed into a single storage slot if possible ...

A: Now it is not like that for Array

b) Whole Warning segment in this section should be out.

  1. Layout in Memory
    https://github.com/arrayio/array-io-solidity/blob/master/miscellaneous.rst#layout-in-memory
  2. Internals - Cleaning Up Variables
    https://github.com/arrayio/array-io-solidity/blob/master/miscellaneous.rst#internals---cleaning-up-variables
  3. Internals - The Optimizer
    https://github.com/arrayio/array-io-solidity/blob/master/miscellaneous.rst#internals---the-optimizer
  4. Source Mappings
    https://github.com/arrayio/array-io-solidity/blob/master/miscellaneous.rst#source-mappings

Tips and Tricks
https://github.com/arrayio/array-io-solidity/blob/master/miscellaneous.rst#tips-and-tricks

Use delete on arrays to delete all its elements.

A: delete doesn't work

Cheatsheet
https://github.com/arrayio/array-io-solidity/blob/master/miscellaneous.rst#cheatsheet
Doesn't work for Array:

  1. New expression:
    new <typename>

  2. Unary operations:
    delete

  3. Exponentiation:
    **

  4. from the row 4 to 16 - remains to be tested...

Global Variables:
https://github.com/arrayio/array-io-solidity/blob/master/miscellaneous.rst#global-variables
Global vars which do not work for Array:

block.blockhash(uint blockNumber) returns (bytes32)
block.coinbase (address)
block.difficulty (uint)
block.gaslimit (uint)
block.number (uint)
gasleft() returns (uint256)
msg.data (bytes)
msg.gas (uint)
now (uint)
tx.gasprice (uint)
tx.origin (address)
revert()
keccak256(...) returns (bytes32)
sha3(...) returns (bytes32)
sha256(...) returns (bytes32):
ripemd160(...) returns (bytes20)
ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address)
addmod(uint x, uint y, uint k) returns (uint)
mulmod(uint x, uint y, uint k) returns (uint)
this
super
selfdestruct(address recipient)
suicide(address recipient)
<address>.send(uint256 amount) returns (bool)

Modifiers
https://github.com/arrayio/array-io-solidity/blob/master/miscellaneous.rst#modifiers
don't work:
anonymous for events: Does not store event signature as topic.
indexed for event parameters: Stores the parameter as topic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions