Skip to content

Instantly share code, notes, and snippets.

@ConsenSys-Academy
ConsenSys-Academy / .travis.yml
Created December 21, 2018 16:19
Travis-CI testing script for Truffle version 4.1.14
language: node_js
- "8"
before_script:
- npm install -g ganache-cli
- npm install -g truffle@4.1.14
script:
- ganache-cli &
- sleep 5
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!
✅ did:muport:QmSJgpCjpP1gTKevmvQospuuntCRiSdLg8Se15ufdNTUPY ✅
Create your profile today to start building social connection and trust online. https://3box.io/
/*
This test file has been updated for Truffle version 5.0. If your tests are failing, make sure that you are
using Truffle version 5.0. You can check this by running "trufffle version" in the terminal. If version 5 is not
installed, you can uninstall the existing version with `npm uninstall -g truffle` and install the latest version (5.0)
with `npm install -g truffle`.
*/
var SimpleBank = artifacts.require("./SimpleBank.sol");
const { expectRevert } = require('@openzeppelin/test-helpers');
contract("SimpleBank", function (accounts) {
/*
This is the test file for the Supply Chain Exercise: https://github.com/ConsenSys-Academy/supply-chain-exercise
This test file has been updated for Truffle version 5.0. If your tests are failing, make sure that you are
using Truffle version 5.0. You can check this by running "truffle version" in the terminal. If version 5 is not
installed, you can uninstall the existing version with `npm uninstall -g truffle` and install the latest version (5.0)
with `npm install -g truffle`.
*/
let BN = web3.utils.BN
let SupplyChain = artifacts.require('SupplyChain')
@ConsenSys-Academy
ConsenSys-Academy / eventTickets.test.js
Last active June 5, 2019 15:22
This is one of the test files for the event tickets exercise here: https://github.com/ConsenSys-Academy/event-ticket-exercise
/*
This is one of the test files for the event tickets exercise here: https://github.com/ConsenSys-Academy/event-ticket-exercise
*/
var EventTickets = artifacts.require('EventTickets')
let catchRevert = require("./exceptionsHelpers.js").catchRevert
const BN = web3.utils.BN
contract('EventTicket', function(accounts) {
const firstAccount = accounts[0]
// This is an automated testing file for this repo: https://github.com/ConsenSys-Academy/event-ticket-exercise
var EventTicketsV2 = artifacts.require('EventTicketsV2')
let catchRevert = require("./exceptionsHelpers.js").catchRevert
const BN = web3.utils.BN
contract('EventTicketV2', function(accounts) {
const deployAccount = accounts[0]
const firstAccount = accounts[3]
// ===== DO NOT MODIFY THIS FILE =====
const BN = web3.utils.BN
const SupplyChain = artifacts.require('SupplyChain')
contract('SupplyChain', accounts => {
const owner = accounts[0]
const alice = accounts[1]
const bob = accounts[2]
const price = '1000'
@ConsenSys-Academy
ConsenSys-Academy / FactoryTest.sol
Last active July 25, 2019 22:03
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.5.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity ^0.5.0;
contract Child {
address creator;
event newChild(address _a);
constructor()
public
{
@ConsenSys-Academy
ConsenSys-Academy / SimpleStorage.json
Last active October 24, 2021 23:10
A Solidity SimpleStorage contract
[
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "x",
"type": "uint256"
}
],
pragma solidity >=0.7.0 <0.9.0;
contract Base {
uint public num;
address public sender;
function setNum(uint _num) public {
num = _num;
sender = msg.sender;
}