Skip to content

Instantly share code, notes, and snippets.

View ayinot's full-sized avatar

skygirl ayinot

  • Singapore
View GitHub Profile
pragma solidity ^0.5.1;
contract Commodity {
struct Product {
string productName;
uint256 productPrice;
uint256 insuranceCode;
uint256 costPrice;
uint256 sellingPrice;
@ayinot
ayinot / ArrayOfMap.sol
Created June 27, 2018 02:15
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.21+commit.dfe3193c.js&optimize=false&gist=
pragma solidity ^0.4.23;
contract ArrayOfMap{
mapping(address => mapping(bytes32 => address[])) addressArray;
function pushAddress(bytes32 _key, address _address) internal constant{
addressArray[msg.sender][_key].push(_address);
pragma solidity ^0.4.10;
import './SafeMath.sol';
interface ERC20 {
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
@ayinot
ayinot / C.sol
Created May 21, 2018 05:35
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.24+commit.e67f0147.js&optimize=false&gist=
import "github.com/Arachnid/solidity-stringutils/strings.sol";
contract C {
using strings for *;
string public s;
function foo(string s1, string s2) {
s = s1.toSlice().concat(s2.toSlice());
}
package com.example.flow
import co.paralleluniverse.fibers.Suspendable
import com.example.contract.LoanContract
import com.example.contract.LoanContract.Companion.Loan_CONTRACT_ID
import com.example.flow.LoanRequestFlow.Acceptor
import com.example.flow.LoanRequestFlow.Initiator
import com.example.state.LoanState
import net.corda.core.contracts.Command
import net.corda.core.contracts.requireThat
package com.example.api
import com.example.flow.LoanRequestFlow.Initiator
import com.example.state.LoanState
import net.corda.core.identity.CordaX500Name
import net.corda.core.identity.Party
import net.corda.core.messaging.CordaRPCOps
import net.corda.core.messaging.startTrackedFlow
import net.corda.core.messaging.vaultQueryBy
package com.example.flow
import co.paralleluniverse.fibers.Suspendable
import com.example.contract.LoanContract
import com.example.contract.LoanContract.Companion.Loan_CONTRACT_ID
import com.example.flow.LoanRequestFlow.Acceptor
import com.example.flow.LoanRequestFlow.Initiator
import com.example.state.LoanState
import net.corda.core.contracts.Command
import net.corda.core.contracts.requireThat
package com.example.contract
import com.example.state.LoanState
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.Contract
import net.corda.core.contracts.requireSingleCommand
import net.corda.core.contracts.requireThat
import net.corda.core.transactions.LedgerTransaction
/**
package com.example.schema
import net.corda.core.schemas.MappedSchema
import net.corda.core.schemas.PersistentState
import java.util.*
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.Table
/**
package com.example.state
import com.example.schema.LoanSchemaV1
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.LinearState
import net.corda.core.contracts.UniqueIdentifier
import net.corda.core.identity.AbstractParty
import net.corda.core.identity.Party
import net.corda.core.schemas.MappedSchema
import net.corda.core.schemas.PersistentState