This file contains hidden or 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.2; | |
contract MyFile { | |
uint public govtrail = 100000; | |
uint public agenttrail = 100000; | |
uint public migtrail = 100000; | |
mapping(address => Government) govdetails; | |
address[] public governmentaccounts; | |
This file contains hidden or 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
contract MappedStructsWithIndex { | |
struct EntityStruct { | |
uint entityData; | |
bool isEntity; | |
} | |
mapping(address => EntityStruct) public entityStructs; | |
address[] public entityList; |
This file contains hidden or 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.2; | |
contract retail { | |
address public admin; | |
uint public count=0; | |
// a constructor to set the admin i.e the person who deploys the contract | |
function retail() { | |
admin= msg.sender; | |
} |
This file contains hidden or 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
const express=require('express'); // importing express js framework | |
const Web3=require('web3'); //initiating web3 | |
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); // connect to blockchain using web3 | |
const bodyParser=require('body-parser'); // pasrsing the encoded format | |
const app=express(); //loading the express object | |
//loading the abi for the contract | |
var retailContract = web3.eth.contract([{"constant":true,"inputs":[{"name":"itemId","type":"uint256"}],"name":"isSold","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getItemList","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"count","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"itemId","type":"uint256"}],"name":"getItem","outputs":[{"name":"","type":"uint256" |
This file contains hidden or 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.15; | |
//@Title to understand FunctionModifiers | |
//@Author Toniya <[email protected]> | |
// It changes the behaviour of the function | |
//Eg Contract kill function should only be called by the admin | |
contract FunctionModifiers { | |
This file contains hidden or 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.15; | |
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. | |
contract MultiSigWallet { | |
/* | |
* Events | |
*/ |
This file contains hidden or 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.18; | |
/** | |
* @title Ownable | |
* @dev The Ownable contract has an owner address, and provides basic authorization control | |
* functions, this simplifies the implementation of "user permissions". | |
*/ | |
contract Ownable { | |
address public owner; |
This file contains hidden or 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.18; | |
import "./Ownable.sol"; | |
contract Proxy is Ownable { | |
event Upgraded(address indexed implementation); | |
address internal _implementation; |
This file contains hidden or 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.18; | |
import "./Proxy.sol"; | |
import "./SafeMath.sol"; | |
contract KeyValueStorage { | |
mapping(address => mapping(bytes32 => uint256)) _uintStorage; | |
mapping(address => mapping(bytes32 => address)) _addressStorage; | |
mapping(address => mapping(bytes32 => bool)) _boolStorage; |
This file contains hidden or 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.18; | |
import "./ShrimpCoin.sol"; | |
contract MintableTokenDelegate is TokenDelegate { | |
modifier onlyOwner { | |
require(msg.sender == _storage.getAddress("owner")); | |
_; | |
} |
OlderNewer