Skip to content

Instantly share code, notes, and snippets.

View himanshuchawla009's full-sized avatar
🎯
Focusing

himanshuchawla009

🎯
Focusing
  • web3auth
  • internet
View GitHub Profile
contract KeyValueStorage {
mapping(address => mapping(bytes32 => uint256)) _uintStorage;
mapping(address => mapping(bytes32 => address)) _addressStorage;
mapping(address => mapping(bytes32 => bool)) _boolStorage;
/**** Get Methods ***********/
function getAddress(bytes32 key) public view returns (address) {
return _addressStorage[msg.sender][key];
pragma solidity ^0.4.18;
import "./Ownable.sol";
import "./StorageState.sol";
contract Proxy is StorageState , Ownable {
function Proxy(KeyValueStorage storage_ , address _owner) public {
_storage = storage_;
_storage.setAddress("owner",_owner);
pragma solidity ^0.4.18;
import "./SafeMath.sol";
import "./StorageState.sol";
contract DelegateV1 is StorageState {
using SafeMath for uint256;
function setNumberOfOwners(uint256 num) public {
pragma solidity ^0.4.18;
import "./DelegateV1.sol";
import "./StorageState.sol";
import "./Ownable.sol";
contract DelegateV2 is StorageState {
modifier onlyOwner() {
require(msg.sender == _storage.getAddress("owner"));
pragma solidity ^0.4.18;
import "./KeyValueStorage.sol";
contract StorageState {
KeyValueStorage _storage;
}
/* global describe it artifacts */
const KeyValueStorage = artifacts.require('KeyValueStorage')
const DelegateV1 = artifacts.require('DelegateV1')
const DelegateV2 = artifacts.require('DelegateV2')
var StellarSdk = require('stellar-sdk');
var rp = require('request-promise');
var express = require('express');
var router = express.Router();
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');
StellarSdk.Network.useTestNetwork();
var transaction;
createAccount = (req,res)=>{
console.log("creating account");
console.log();
pragma solidity 0.4.21;
contract Ownable {
address public owner;
address public creater;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
cat << "EOF"
______ __ __ __ __ __ __ __ ___ _______. __ __
/ __ \ | | | | | | | | | | | | | | / \ / || | | |
| | | | | | | | | | | | | | | |__| | / ^ \ | (----`| |__| |
| | | | | | | | | | | | | | | __ | / /_\ \ \ \ | __ |
| `--' '--.| `--' | | | | `----.| `----.| | | | / _____ \ .----) | | | | |
\_____\_____\\______/ |__| |_______||_______||__| |__| /__/ \__\ |_______/ |__| |__|