Skip to content

Instantly share code, notes, and snippets.

View code-brewer's full-sized avatar

wangyouhua code-brewer

View GitHub Profile
@code-brewer
code-brewer / ByteStringOp.sol
Created October 14, 2018 15:44
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity 0.4.25;
contract stringOpTest {
byte[] bs;
function convertingToString()public returns(string){
// bytes32 memory hw = "Hello World"; // TypeError: Storage location can only be given for array or struct types.
bytes32 hw = "Hello World"; //
@code-brewer
code-brewer / ByteStringOp.sol
Created October 14, 2018 14:57
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity 0.4.25;
contract stringOpTest {
byte[] bs;
function convertingToString()public returns(string){
// bytes32 memory hw = "Hello World"; // TypeError: Storage location can only be given for array or struct types.
bytes32 hw = "Hello World"; //
@code-brewer
code-brewer / ByteStringOp.sol
Created October 13, 2018 13:44
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity 0.4.25;
contract stringOpTest {
byte[] bs;
function convertingToString()public returns(string){
// bytes32 memory hw = "Hello World"; // TypeError: Storage location can only be given for array or struct types.
bytes32 hw = "Hello World"; //
@code-brewer
code-brewer / ByteStringOp.sol
Created October 12, 2018 14:00
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity 0.4.25;
contract stringOpTest {
byte[] bs;
function convertingToString()public returns(string){
// bytes32 memory hw = "Hello World"; // TypeError: Storage location can only be given for array or struct types.
bytes32 hw = "Hello World"; //
@code-brewer
code-brewer / ByteStringOp.sol
Created October 12, 2018 09:57
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity 0.4.25;
contract stringOpTest {
byte[] bs;
function convertingToString()public returns(string){
// bytes32 memory hw = "Hello World"; // TypeError: Storage location can only be given for array or struct types.
bytes32 hw = "Hello World"; //
@code-brewer
code-brewer / ByteStringOp.sol
Created October 12, 2018 09:52
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity 0.4.25;
contract stringOpTest {
byte[] bs;
function convertingToString()public returns(string){
// bytes32 memory hw = "Hello World"; // TypeError: Storage location can only be given for array or struct types.
bytes32 hw = "Hello World"; //
@code-brewer
code-brewer / ByteStringOp.sol
Created October 12, 2018 09:49
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity 0.4.25;
contract stringOpTest {
byte[] bs;
function convertingToString()public returns(string){
// bytes32 memory hw = "Hello World"; // TypeError: Storage location can only be given for array or struct types.
bytes32 hw = "Hello World"; //
@code-brewer
code-brewer / ByteStringOp.sol
Created October 12, 2018 08:49
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity 0.4.25;
contract stringOpTest {
byte[] bs;
function convertingToString()public returns(string){
// bytes32 memory hw = "Hello World"; // TypeError: Storage location can only be given for array or struct types.
bytes32 hw = "Hello World"; //
@code-brewer
code-brewer / EventTest.sol
Created October 12, 2018 02:50
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.25;
contract SimpleStorage {
uint public data;
// event SetX(address indexed _from, uint value);
event Set(string label, uint value);
function set(uint x) public {
data = x;
// emit SetX(msg.sender, x);
// emit Set("#####", x);
}
@code-brewer
code-brewer / EventTest.sol
Created October 12, 2018 02:34
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.25;
contract SimpleStorage {
uint public data;
// event SetX(address indexed _from, uint value);
event Set(string label, uint value);
function set(uint x) public {
data = x;
// emit SetX(msg.sender, x);
// emit Set("#####", x);
}