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 { promises: fs } = require('fs'); | |
const path = require('path'); | |
// find plugins in a directory, matching a pattern, ignoring registered plugins | |
function findPlugins(dir, pattern, registered) { | |
let segments = pattern.split('/'); | |
let regexp = new RegExp(`^${segments.pop().replace('*', '.*')}`); | |
dir = path.join(dir, ...segments); | |
return fs.readdir(dir).then(f => f.reduce((plugins, dirname) => { |
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.5.0; | |
contract Token { | |
mapping (address => uint) tokenBalance; | |
mapping (address => uint) etherBalance; | |
uint currentRate; | |
constructor() public { | |
currentRate = 2; |
OlderNewer