This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.1; | |
contract Commodity { | |
struct Product { | |
string productName; | |
uint256 productPrice; | |
uint256 insuranceCode; | |
uint256 costPrice; | |
uint256 sellingPrice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder