One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| const solc = require("solc"); | |
| const fs = require("fs"); | |
| const Web3 = require('web3'); | |
| const password = "test"; | |
| //web3 provider. can also use ws if started node as websocket | |
| var web3 = new Web3( | |
| new Web3.providers.HttpProvider('http://localhost:8545')); | |
| //Read solidity contract file |
| pragma solidity ^0.4.0; | |
| contract MappyingContract{ | |
| mapping(uint => uint[])luckyNumbers; | |
| mapping(address => uint [])addNumbers; | |
| uint[] numbers; | |
| constructor() public{ | |
| luckyNumbers[0] = [1,2,3,4]; | |
| luckyNumbers[1] = [1,2,3,5]; |
| //This is how you declare a class signature which uses a Generic Type | |
| public class GenericList<Type> | |
| { | |
| public void Add(Type input) | |
| { | |
| //logic for adding to list.. | |
| Console.WriteLine(input.ToString()); | |
| } | |
| } |
| public T Add<T> (T num1, T num2) | |
| { | |
| dynamic a = num1; | |
| dynamic b = num2; | |
| return a + b; | |
| } |
| class GenericClass<T> where T | |
| { | |
| private T _genericField; | |
| public T genericProperty { get; set; } | |
| public GenericClass(T value) | |
| { | |
| _genericField = value; | |
| } |
| class GenericClass<T> where T : class | |
| { | |
| private T _genericField; | |
| public T genericProperty { get; set; } | |
| public GenericClass(T value) | |
| { | |
| _genericField = value; | |
| } |
| using System; | |
| using System.Collections.Generic; | |
| namespace OpenClosedPrincipleExample | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var customerMessages = new List<Message> |
| pragma solidity ^0.5.0; | |
| contract EthChatter { | |
| struct Message{ | |
| address sender; | |
| bytes32 message; | |
| bool encrypted; | |
| } |
I hereby claim:
To claim this, I am signing this object: