Confirm to style guide

This commit is contained in:
Chris Ward 2019-05-23 14:45:16 +02:00
parent 2491ce45a1
commit 5305dd6eac

View File

@ -214,10 +214,11 @@ Given the contract:
pragma solidity >=0.4.16 <0.7.0; pragma solidity >=0.4.16 <0.7.0;
contract Foo { contract Foo {
function bar(bytes3[2] memory) public pure {} function bar(bytes3[2] memory) public pure {}
function baz(uint32 x, bool y) public pure returns (bool r) { r = x > 32 || y; } function baz(uint32 x, bool y) public pure returns (bool r) { r = x > 32 || y; }
function sam(bytes memory, bool, uint[] memory) public pure {} function sam(bytes memory, bool, uint[] memory) public pure {}
} }
@ -485,12 +486,13 @@ For example,
pragma solidity >=0.5.0 <0.7.0; pragma solidity >=0.5.0 <0.7.0;
contract Test { contract Test {
constructor() public { b = hex"12345678901234567890123456789012"; } constructor() public { b = hex"12345678901234567890123456789012"; }
event Event(uint indexed a, bytes32 b); event Event(uint indexed a, bytes32 b);
event Event2(uint indexed a, bytes32 b); event Event2(uint indexed a, bytes32 b);
function foo(uint a) public { emit Event(a, b); } function foo(uint a) public { emit Event(a, b); }
bytes32 b; bytes32 b;
} }
would result in the JSON: would result in the JSON:
@ -533,11 +535,12 @@ As an example, the code
pragma solidity >=0.4.19 <0.7.0; pragma solidity >=0.4.19 <0.7.0;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
contract Test { contract Test {
struct S { uint a; uint[] b; T[] c; } struct S { uint a; uint[] b; T[] c; }
struct T { uint x; uint y; } struct T { uint x; uint y; }
function f(S memory s, T memory t, uint a) public; function f(S memory s, T memory t, uint a) public;
function g() public returns (S memory s, T memory t, uint a); function g() public returns (S memory s, T memory t, uint a);
} }
would result in the JSON: would result in the JSON: