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
| /** | |
| based on | |
| https://solidity.readthedocs.io/en/v0.5.14/solidity-by-example.html | |
| */ | |
| pragma solidity >=0.4.22 <0.7.0; | |
| import "@openzeppelin/contracts/math/SafeMath.sol"; | |
| import "./Ownable.sol"; | |
| contract SafeRemotePurchase is Ownable { |
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.22 <0.7.0; | |
| import "./HitchensUnorderedKeySet.sol"; | |
| import "./SafeRemotePurchase.sol"; | |
| import "./Ownable.sol"; | |
| contract FleaMarketFactory is Ownable { | |
| using HitchensUnorderedKeySetLib for HitchensUnorderedKeySetLib.Set; | |
| HitchensUnorderedKeySetLib.Set private widgetSet; |
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
| { | |
| "extends": "solhint:recommended", | |
| "plugins": [], | |
| "rules": { | |
| "avoid-suicide": "error", | |
| "avoid-sha3": "warn", | |
| "avoid-tx-origin:": "warn", | |
| "avoid-throw": "off", | |
| "indent": "off", | |
| "no-mix-tabs-and-spaces": "off" |
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 FleaMarketContract = artifacts.require("FleaMarketFactory"); | |
| module.exports = async (deployer) => { | |
| await deployer.deploy(FleaMarketContract); | |
| const contract = await FleaMarketContract.deployed(); | |
| console.log(`Contract has been deployed successfully: ${contract.address}`); | |
| }; |
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
| var chai = require('chai'); | |
| chai.use(require('chai-as-promised')).should(); | |
| const BN = web3.utils.BN; | |
| // Enable and inject BN dependency | |
| chai.use(require('chai-bn')(BN)); | |
| var expect = chai.expect; | |
| var assert = chai.assert; | |
| var should = chai.should(); |
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
| export interface AppState { | |
| router: fromRouter.RouterReducerState<any>; | |
| spinner: fromSpinner.SpinnerState; | |
| error: fromError.ErrorState; | |
| } |
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
| import { ErrorEffects } from './error.effects'; | |
| import { SnackBarEffects } from './snack-bar.effect'; | |
| import { SpinnerEffects } from './spinner.effect'; | |
| export const effects: any[] = [ErrorEffects, SnackBarEffects, SpinnerEffects]; | |
| export * from './error.effects'; | |
| export * from './snack-bar.effect'; | |
| export * from './spinner.effect'; |
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
| import { Injectable } from '@angular/core'; | |
| import { Actions, ofType, createEffect } from '@ngrx/effects'; | |
| import { tap, map } from 'rxjs/operators'; | |
| import { ErrorActions, SnackBarActions } from '../actions'; | |
| import { AppearanceColor, SnackBarInterface } from '../../models'; | |
| @Injectable() | |
| export class ErrorEffects { | |
| constructor(private readonly actions$: Actions) { |
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
| import { createAction, props } from '@ngrx/store'; | |
| import { SnackBarInterface } from '../../models'; | |
| export const open = createAction('[SnackBar] Open', props<{ payload: SnackBarInterface }>()); |
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
| import { InjectionToken} from '@angular/core'; | |
| export const MetamaskEthereumToken = new InjectionToken( | |
| 'MetaMask Web3 provider', | |
| { | |
| providedIn: 'root', | |
| factory: () => { | |
| const ethereum = (window as any).ethereum; | |
| // Returns true or false, representing whether the user has MetaMask installed. |