├── .gitignore ├── README.md ├── contracts ├── FaucetToken.sol └── Migrations.sol ├── front ├── .editorconfig ├── .env.exmaple ├── .eslintrc.js ├── .gitignore ├── .nvmrc ├── .prettierrc ├── README.md ├── abis │ └── ERC20.abi.json ├── assets │ ├── README.md │ ├── img │ │ ├── alert-circle.svg │ │ ├── authereum.svg │ │ ├── bg.jpg │ │ ├── check.svg │ │ ├── github.svg │ │ ├── logo.svg │ │ ├── madeby.svg │ │ ├── metamask-fox.svg │ │ ├── mewconnect.svg │ │ ├── portis.svg │ │ ├── telegram.svg │ │ ├── twitter.svg │ │ └── walletconnect.svg │ └── styles │ │ └── styles.scss ├── components │ ├── Modal.vue │ ├── NetworkSelect.vue │ └── README.md ├── gulpfile.js ├── layouts │ ├── README.md │ ├── default.vue │ └── error.vue ├── middleware │ └── README.md ├── netlify.toml ├── networkConfig.js ├── nuxt.config.js ├── package.json ├── pages │ ├── 451.vue │ ├── README.md │ └── index.vue ├── plugins │ ├── README.md │ └── ads.js ├── services │ ├── estimateGas.js │ ├── gasOracle.js │ └── index.js ├── static │ ├── CNAME │ ├── ERC20 Token Faucet.jpg │ ├── README.md │ ├── apple-touch-icon-180x180.png │ ├── favicon.ico │ └── fb.png ├── store │ ├── README.md │ ├── gasPrice.js │ ├── metamask.js │ └── token.js ├── utils │ ├── errorParser.js │ └── index.js └── yarn.lock ├── migrations ├── 1_initial_migration.js └── 2_deploy.js ├── package.json ├── test ├── bootstrap.js ├── first.js └── kill.sh ├── truffle-config.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | flatToken.sol 4 | .idea -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](https://raw.githubusercontent.com/peppersec/erc20faucet/master/front/static/ERC20%20Token%20Faucet.jpg) 2 | 3 | # ERC20 Token Faucet 4 | 5 | An ERC20 token faucet on the Ethereum mainnet, and Ropsten, Kovan, Rinkeby and Görli testnets. 6 | 7 |
8 | 9 | Visit [https://erc20faucet.com/](https://erc20faucet.com/) page, set appropriate token amount, click "Mint Free Tokens" button. That's it! 10 | 11 | You will need some ethers (ETH) to pay for the network transaction fees. See [Testnet Ether Faucets](#testnet-ether-faucets) below to obtain testnet ethers. 12 | 13 | # Deployed Faucet Token 14 | 15 | | Network | Address | 16 | | ------------- | ------------- | 17 | | Mainnet | [0xfab46e002bbf0b4509813474841e0716e6730136](https://etherscan.io/token/0xfab46e002bbf0b4509813474841e0716e6730136) | 18 | | Ropsten | [0xfab46e002bbf0b4509813474841e0716e6730136](https://ropsten.etherscan.io/token/0xfab46e002bbf0b4509813474841e0716e6730136) | 19 | | Rinkeby | [0xfab46e002bbf0b4509813474841e0716e6730136](https://rinkeby.etherscan.io/token/0xfab46e002bbf0b4509813474841e0716e6730136) | 20 | | Görli | [0xba62bcfcaafc6622853cca2be6ac7d845bc0f2dc](https://goerli.etherscan.io/address/0xba62bcfcaafc6622853cca2be6ac7d845bc0f2dc) | 21 | | Kovan | [0xfab46e002bbf0b4509813474841e0716e6730136](https://kovan.etherscan.io/token/0xfab46e002bbf0b4509813474841e0716e6730136) | 22 | | POA | [0x8dc4f704a5fdf9f09ed561381bd02187201a83b8](https://blockscout.com/poa/core/tokens/0x8dc4f704a5fdf9f09ed561381bd02187201a83b8/token_transfers) | 23 | 24 |
25 | 26 | # Testnet Ether Faucets 27 | 28 | Testnet | Explorers | Testnet ETH Faucets 29 | :-------- |:----------------------------- |:------------------------- 30 | Ropsten | https://ropsten.etherscan.io/ | https://faucet.metamask.io/
https://twitter.com/BokkyPooBah/status/1099498823699714048 31 | Kovan | https://kovan.etherscan.io/ | https://faucet.kovan.network/
https://github.com/kovan-testnet/faucet
https://faucet.kovan.radarrelay.com/ 32 | Rinkeby | https://rinkeby.etherscan.io/ | https://faucet.rinkeby.io/
https://faucet.metamask.io/ 33 | Görli | https://goerli.etherscan.io/ | https://faucet.goerli.mudit.blog/
https://goerli-faucet.slock.it/
https://bridge.goerli.com/ 34 | 35 |
36 | 37 | Please submit PR with updates to the information above. 38 | 39 |
40 | 41 |
42 | 43 | Enjoy! 44 | 45 | (c) PepperSec.com / The MIT Licence. 46 | -------------------------------------------------------------------------------- /contracts/FaucetToken.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.5.4; 2 | 3 | import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; 4 | import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; 5 | import "openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol"; 6 | import "openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol"; 7 | 8 | contract FaucetToken is ERC20, ERC20Detailed, ERC20Mintable, ERC20Burnable { 9 | uint8 public constant DECIMALS = 18; 10 | uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(DECIMALS)); 11 | 12 | /** 13 | * @dev Constructor that gives msg.sender all of existing tokens. 14 | */ 15 | constructor () public ERC20Detailed("FaucetToken", "FAU", DECIMALS) { 16 | } 17 | 18 | function() external { 19 | mint(msg.sender, 1 ether); 20 | } 21 | 22 | function mint(address to, uint256 value) public returns (bool) { 23 | require(value <= 10000000 ether, "dont be greedy"); 24 | _mint(to, value); 25 | return true; 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.4.21 <0.6.0; 2 | 3 | contract Migrations { 4 | address public owner; 5 | uint public last_completed_migration; 6 | 7 | constructor() public { 8 | owner = msg.sender; 9 | } 10 | 11 | modifier restricted() { 12 | if (msg.sender == owner) _; 13 | } 14 | 15 | function setCompleted(uint completed) public restricted { 16 | last_completed_migration = completed; 17 | } 18 | 19 | function upgrade(address new_address) public restricted { 20 | Migrations upgraded = Migrations(new_address); 21 | upgraded.setCompleted(last_completed_migration); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /front/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /front/.env.exmaple: -------------------------------------------------------------------------------- 1 | INFURA_ID= 2 | -------------------------------------------------------------------------------- /front/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | browser: true, 5 | node: true 6 | }, 7 | parserOptions: { 8 | parser: 'babel-eslint' 9 | }, 10 | extends: [ 11 | '@nuxtjs', 12 | 'plugin:nuxt/recommended' 13 | ], 14 | // add your custom rules here 15 | rules: { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /front/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | .env 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | 62 | # parcel-bundler cache (https://parceljs.org/) 63 | .cache 64 | 65 | # next.js build output 66 | .next 67 | 68 | # nuxt.js build output 69 | .nuxt 70 | 71 | # Nuxt generate 72 | dist 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless 79 | 80 | # IDE 81 | .idea 82 | 83 | # Service worker 84 | sw.* 85 | -------------------------------------------------------------------------------- /front/.nvmrc: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /front/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "arrowParens": "always", 4 | "singleQuote": true, 5 | "printWidth": 110 6 | } 7 | -------------------------------------------------------------------------------- /front/README.md: -------------------------------------------------------------------------------- 1 | # front 2 | 3 | > My groundbreaking Nuxt.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | $ yarn install 10 | 11 | # serve with hot reload at localhost:3000 12 | $ yarn run dev 13 | 14 | # build for production and launch server 15 | $ yarn run build 16 | $ yarn start 17 | 18 | # generate static project 19 | $ yarn run generate 20 | ``` 21 | 22 | For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org). 23 | -------------------------------------------------------------------------------- /front/abis/ERC20.abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "inputs": [], 5 | "name": "name", 6 | "outputs": [ 7 | { 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "payable": false, 13 | "stateMutability": "view", 14 | "type": "function", 15 | "signature": "0x06fdde03" 16 | }, 17 | { 18 | "constant": false, 19 | "inputs": [ 20 | { 21 | "name": "spender", 22 | "type": "address" 23 | }, 24 | { 25 | "name": "value", 26 | "type": "uint256" 27 | } 28 | ], 29 | "name": "approve", 30 | "outputs": [ 31 | { 32 | "name": "", 33 | "type": "bool" 34 | } 35 | ], 36 | "payable": false, 37 | "stateMutability": "nonpayable", 38 | "type": "function", 39 | "signature": "0x095ea7b3" 40 | }, 41 | { 42 | "constant": true, 43 | "inputs": [], 44 | "name": "totalSupply", 45 | "outputs": [ 46 | { 47 | "name": "", 48 | "type": "uint256" 49 | } 50 | ], 51 | "payable": false, 52 | "stateMutability": "view", 53 | "type": "function", 54 | "signature": "0x18160ddd" 55 | }, 56 | { 57 | "constant": false, 58 | "inputs": [ 59 | { 60 | "name": "from", 61 | "type": "address" 62 | }, 63 | { 64 | "name": "to", 65 | "type": "address" 66 | }, 67 | { 68 | "name": "value", 69 | "type": "uint256" 70 | } 71 | ], 72 | "name": "transferFrom", 73 | "outputs": [ 74 | { 75 | "name": "", 76 | "type": "bool" 77 | } 78 | ], 79 | "payable": false, 80 | "stateMutability": "nonpayable", 81 | "type": "function", 82 | "signature": "0x23b872dd" 83 | }, 84 | { 85 | "constant": true, 86 | "inputs": [], 87 | "name": "DECIMALS", 88 | "outputs": [ 89 | { 90 | "name": "", 91 | "type": "uint8" 92 | } 93 | ], 94 | "payable": false, 95 | "stateMutability": "view", 96 | "type": "function", 97 | "signature": "0x2e0f2625" 98 | }, 99 | { 100 | "constant": true, 101 | "inputs": [], 102 | "name": "INITIAL_SUPPLY", 103 | "outputs": [ 104 | { 105 | "name": "", 106 | "type": "uint256" 107 | } 108 | ], 109 | "payable": false, 110 | "stateMutability": "view", 111 | "type": "function", 112 | "signature": "0x2ff2e9dc" 113 | }, 114 | { 115 | "constant": true, 116 | "inputs": [], 117 | "name": "decimals", 118 | "outputs": [ 119 | { 120 | "name": "", 121 | "type": "uint8" 122 | } 123 | ], 124 | "payable": false, 125 | "stateMutability": "view", 126 | "type": "function", 127 | "signature": "0x313ce567" 128 | }, 129 | { 130 | "constant": false, 131 | "inputs": [ 132 | { 133 | "name": "spender", 134 | "type": "address" 135 | }, 136 | { 137 | "name": "addedValue", 138 | "type": "uint256" 139 | } 140 | ], 141 | "name": "increaseAllowance", 142 | "outputs": [ 143 | { 144 | "name": "", 145 | "type": "bool" 146 | } 147 | ], 148 | "payable": false, 149 | "stateMutability": "nonpayable", 150 | "type": "function", 151 | "signature": "0x39509351" 152 | }, 153 | { 154 | "constant": false, 155 | "inputs": [ 156 | { 157 | "name": "value", 158 | "type": "uint256" 159 | } 160 | ], 161 | "name": "burn", 162 | "outputs": [], 163 | "payable": false, 164 | "stateMutability": "nonpayable", 165 | "type": "function", 166 | "signature": "0x42966c68" 167 | }, 168 | { 169 | "constant": true, 170 | "inputs": [ 171 | { 172 | "name": "owner", 173 | "type": "address" 174 | } 175 | ], 176 | "name": "balanceOf", 177 | "outputs": [ 178 | { 179 | "name": "", 180 | "type": "uint256" 181 | } 182 | ], 183 | "payable": false, 184 | "stateMutability": "view", 185 | "type": "function", 186 | "signature": "0x70a08231" 187 | }, 188 | { 189 | "constant": false, 190 | "inputs": [ 191 | { 192 | "name": "from", 193 | "type": "address" 194 | }, 195 | { 196 | "name": "value", 197 | "type": "uint256" 198 | } 199 | ], 200 | "name": "burnFrom", 201 | "outputs": [], 202 | "payable": false, 203 | "stateMutability": "nonpayable", 204 | "type": "function", 205 | "signature": "0x79cc6790" 206 | }, 207 | { 208 | "constant": true, 209 | "inputs": [], 210 | "name": "symbol", 211 | "outputs": [ 212 | { 213 | "name": "", 214 | "type": "string" 215 | } 216 | ], 217 | "payable": false, 218 | "stateMutability": "view", 219 | "type": "function", 220 | "signature": "0x95d89b41" 221 | }, 222 | { 223 | "constant": false, 224 | "inputs": [ 225 | { 226 | "name": "account", 227 | "type": "address" 228 | } 229 | ], 230 | "name": "addMinter", 231 | "outputs": [], 232 | "payable": false, 233 | "stateMutability": "nonpayable", 234 | "type": "function", 235 | "signature": "0x983b2d56" 236 | }, 237 | { 238 | "constant": false, 239 | "inputs": [], 240 | "name": "renounceMinter", 241 | "outputs": [], 242 | "payable": false, 243 | "stateMutability": "nonpayable", 244 | "type": "function", 245 | "signature": "0x98650275" 246 | }, 247 | { 248 | "constant": false, 249 | "inputs": [ 250 | { 251 | "name": "spender", 252 | "type": "address" 253 | }, 254 | { 255 | "name": "subtractedValue", 256 | "type": "uint256" 257 | } 258 | ], 259 | "name": "decreaseAllowance", 260 | "outputs": [ 261 | { 262 | "name": "", 263 | "type": "bool" 264 | } 265 | ], 266 | "payable": false, 267 | "stateMutability": "nonpayable", 268 | "type": "function", 269 | "signature": "0xa457c2d7" 270 | }, 271 | { 272 | "constant": false, 273 | "inputs": [ 274 | { 275 | "name": "to", 276 | "type": "address" 277 | }, 278 | { 279 | "name": "value", 280 | "type": "uint256" 281 | } 282 | ], 283 | "name": "transfer", 284 | "outputs": [ 285 | { 286 | "name": "", 287 | "type": "bool" 288 | } 289 | ], 290 | "payable": false, 291 | "stateMutability": "nonpayable", 292 | "type": "function", 293 | "signature": "0xa9059cbb" 294 | }, 295 | { 296 | "constant": true, 297 | "inputs": [ 298 | { 299 | "name": "account", 300 | "type": "address" 301 | } 302 | ], 303 | "name": "isMinter", 304 | "outputs": [ 305 | { 306 | "name": "", 307 | "type": "bool" 308 | } 309 | ], 310 | "payable": false, 311 | "stateMutability": "view", 312 | "type": "function", 313 | "signature": "0xaa271e1a" 314 | }, 315 | { 316 | "constant": true, 317 | "inputs": [ 318 | { 319 | "name": "owner", 320 | "type": "address" 321 | }, 322 | { 323 | "name": "spender", 324 | "type": "address" 325 | } 326 | ], 327 | "name": "allowance", 328 | "outputs": [ 329 | { 330 | "name": "", 331 | "type": "uint256" 332 | } 333 | ], 334 | "payable": false, 335 | "stateMutability": "view", 336 | "type": "function", 337 | "signature": "0xdd62ed3e" 338 | }, 339 | { 340 | "inputs": [], 341 | "payable": false, 342 | "stateMutability": "nonpayable", 343 | "type": "constructor", 344 | "signature": "constructor" 345 | }, 346 | { 347 | "payable": false, 348 | "stateMutability": "nonpayable", 349 | "type": "fallback" 350 | }, 351 | { 352 | "anonymous": false, 353 | "inputs": [ 354 | { 355 | "indexed": true, 356 | "name": "account", 357 | "type": "address" 358 | } 359 | ], 360 | "name": "MinterAdded", 361 | "type": "event", 362 | "signature": "0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6" 363 | }, 364 | { 365 | "anonymous": false, 366 | "inputs": [ 367 | { 368 | "indexed": true, 369 | "name": "account", 370 | "type": "address" 371 | } 372 | ], 373 | "name": "MinterRemoved", 374 | "type": "event", 375 | "signature": "0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692" 376 | }, 377 | { 378 | "anonymous": false, 379 | "inputs": [ 380 | { 381 | "indexed": true, 382 | "name": "from", 383 | "type": "address" 384 | }, 385 | { 386 | "indexed": true, 387 | "name": "to", 388 | "type": "address" 389 | }, 390 | { 391 | "indexed": false, 392 | "name": "value", 393 | "type": "uint256" 394 | } 395 | ], 396 | "name": "Transfer", 397 | "type": "event", 398 | "signature": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" 399 | }, 400 | { 401 | "anonymous": false, 402 | "inputs": [ 403 | { 404 | "indexed": true, 405 | "name": "owner", 406 | "type": "address" 407 | }, 408 | { 409 | "indexed": true, 410 | "name": "spender", 411 | "type": "address" 412 | }, 413 | { 414 | "indexed": false, 415 | "name": "value", 416 | "type": "uint256" 417 | } 418 | ], 419 | "name": "Approval", 420 | "type": "event", 421 | "signature": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" 422 | }, 423 | { 424 | "constant": false, 425 | "inputs": [ 426 | { 427 | "name": "to", 428 | "type": "address" 429 | }, 430 | { 431 | "name": "value", 432 | "type": "uint256" 433 | } 434 | ], 435 | "name": "mint", 436 | "outputs": [ 437 | { 438 | "name": "", 439 | "type": "bool" 440 | } 441 | ], 442 | "payable": false, 443 | "stateMutability": "nonpayable", 444 | "type": "function", 445 | "signature": "0x40c10f19" 446 | } 447 | ] -------------------------------------------------------------------------------- /front/assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). 8 | -------------------------------------------------------------------------------- /front/assets/img/alert-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /front/assets/img/authereum.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by potrace 1.15, written by Peter Selinger 2001-2017 9 | 10 | 12 | 22 | 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /front/assets/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peppersec/erc20faucet/b06d26a892ea2cc1d3ba69924f1f199b606bbaaf/front/assets/img/bg.jpg -------------------------------------------------------------------------------- /front/assets/img/check.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /front/assets/img/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /front/assets/img/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /front/assets/img/madeby.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /front/assets/img/metamask-fox.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /front/assets/img/mewconnect.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | SVG/c_medium_mewconnect 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /front/assets/img/portis.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /front/assets/img/telegram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /front/assets/img/twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /front/assets/img/walletconnect.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /front/assets/styles/styles.scss: -------------------------------------------------------------------------------- 1 | @import '~bulma/sass/utilities/_all'; 2 | 3 | $primary: #90ffbd; 4 | $primary-invert: #000403; 5 | 6 | $body-family: 'Montserrat', BlinkMacSystemFont, -apple-system, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 7 | 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; 8 | $body-background-color: $primary-invert; 9 | $body-color: #fff; 10 | $navbar-background-color: transparent; 11 | $navbar-item-img-max-height: 2.5rem; 12 | $footer-background-color: rgba(0, 4, 3, 0.8); 13 | $footer-padding: 1.5rem; 14 | $title-color: #fff; 15 | $title-size: $size-5; 16 | $subtitle-color: $primary; 17 | $subtitle-size: $size-3; 18 | $colors: mergeColorMaps( 19 | ( 20 | 'white': ( 21 | $white, 22 | $black 23 | ), 24 | 'black': ( 25 | $black, 26 | $white 27 | ), 28 | 'light': ( 29 | $light, 30 | $light-invert 31 | ), 32 | 'dark': ( 33 | $dark, 34 | $dark-invert 35 | ), 36 | 'primary': ( 37 | $primary, 38 | $primary-invert 39 | ), 40 | 'link': ( 41 | $link, 42 | $link-invert 43 | ), 44 | 'info': ( 45 | $info, 46 | $info-invert 47 | ), 48 | 'success': ( 49 | $success, 50 | $success-invert 51 | ), 52 | 'warning': ( 53 | $warning, 54 | $warning-invert 55 | ), 56 | 'danger': ( 57 | $danger, 58 | $danger-invert 59 | ) 60 | ), 61 | $custom-colors 62 | ); 63 | $label-color: #fff; 64 | $label-weight: $weight-normal; 65 | $input-color: #fff; 66 | $input-placeholder-color: #666; 67 | $input-background-color: transparent; 68 | $input-shadow: none; 69 | $input-border-color: #323232; 70 | $input-hover-border-color: #323232; 71 | $input-height: 58px; 72 | 73 | $link: #fff; 74 | $link-hover: $primary; 75 | $link-invert: $primary; 76 | 77 | $modal-card-title-color: $primary; 78 | $modal-card-head-background-color: #000403; 79 | $modal-card-head-border-bottom: none; 80 | $modal-card-foot-border-top: none; 81 | $modal-card-body-background-color: #000403; 82 | $modal-content-width: auto; 83 | $modal-card-body-padding: 0 20px 20px 20px; 84 | $radius-small: 4px; 85 | 86 | @import '~bulma/sass/base/_all'; 87 | @import '~bulma/sass/elements/_all'; 88 | @import '~bulma/sass/components/_all'; 89 | @import '~bulma/sass/grid/_all'; 90 | @import '~bulma/sass/layout/_all'; 91 | @import '~buefy/src/scss/buefy'; 92 | 93 | #__layout { 94 | > div { 95 | display: flex; 96 | min-height: 100vh; 97 | flex-direction: column; 98 | position: relative; 99 | 100 | @include tablet { 101 | background-image: url('../img/bg.jpg'); 102 | background-repeat: no-repeat; 103 | background-position: 60vw center; 104 | background-size: 90vh; 105 | } 106 | 107 | @include desktop { 108 | background-position-x: 50vw; 109 | } 110 | 111 | > section.main-content { 112 | flex: 1; 113 | 114 | .is-centered-main-content & { 115 | display: flex; 116 | align-items: center; 117 | } 118 | } 119 | } 120 | } 121 | 122 | .navbar { 123 | padding: 20px 1.5rem 0 1.5rem; 124 | 125 | > .container { 126 | .navbar-brand { 127 | margin-left: 0; 128 | 129 | .navbar-item { 130 | padding: 0; 131 | 132 | height: 2.5rem; 133 | width: 9.75rem; 134 | } 135 | } 136 | } 137 | } 138 | 139 | .explorer { 140 | .control { 141 | width: 100%; 142 | 143 | a { 144 | display: block; 145 | overflow: hidden; 146 | text-overflow: ellipsis; 147 | } 148 | } 149 | } 150 | 151 | a:focus { 152 | outline: none; 153 | } 154 | 155 | .footer { 156 | font-size: 12px; 157 | color: #666666; 158 | 159 | > .container { 160 | display: flex; 161 | justify-content: space-between; 162 | align-items: center; 163 | 164 | @include mobile { 165 | flex-direction: column; 166 | } 167 | 168 | .footer-brand { 169 | background-size: contain; 170 | width: 6.813rem; 171 | height: 1.75rem; 172 | 173 | @include mobile { 174 | margin-bottom: 0.5rem; 175 | } 176 | } 177 | 178 | .copyright { 179 | text-align: center; 180 | 181 | @include mobile { 182 | margin-bottom: 0.5rem; 183 | } 184 | 185 | @include tablet { 186 | position: absolute; 187 | left: 0; 188 | right: 0; 189 | } 190 | } 191 | 192 | .button { 193 | background-color: transparent; 194 | border-color: transparent; 195 | } 196 | } 197 | } 198 | 199 | .icon { 200 | background-repeat: no-repeat; 201 | background-position: center; 202 | &-twitter { 203 | background-image: url('../img/twitter.svg'); 204 | } 205 | &-telegram { 206 | background-image: url('../img/telegram.svg'); 207 | } 208 | &-github { 209 | background-image: url('../img/github.svg'); 210 | } 211 | 212 | &-madeby { 213 | width: 81px; 214 | height: 73px; 215 | background-image: url('../img/madeby.svg'); 216 | } 217 | } 218 | 219 | // buefy style overwrite 220 | .label { 221 | font-weight: $weight-normal; 222 | font-size: 14px; 223 | &:not(:last-child) { 224 | margin-bottom: 0; 225 | } 226 | } 227 | 228 | .input { 229 | border-top: 0; 230 | border-right: 0; 231 | border-left: 0; 232 | border-radius: 0; 233 | font-weight: $weight-semibold; 234 | padding: 12px 0; 235 | height: $input-height; 236 | 237 | &:focus, 238 | &.is-focused, 239 | &:active, 240 | &.is-active { 241 | box-shadow: none !important; 242 | } 243 | } 244 | 245 | .field-height { 246 | min-height: 104px; 247 | 248 | .control { 249 | .help.counter { 250 | visibility: visible !important; 251 | } 252 | 253 | &.has-icons-right { 254 | .input { 255 | padding-right: 40px; 256 | } 257 | 258 | .icon { 259 | width: 24px; 260 | 261 | .mdi { 262 | background-repeat: no-repeat; 263 | background-size: contain; 264 | 265 | &-24px { 266 | height: 24px; 267 | width: 24px; 268 | } 269 | } 270 | } 271 | } 272 | } 273 | } 274 | 275 | .has-text-danger .mdi-alert-circle { 276 | background-image: url('../img/alert-circle.svg'); 277 | } 278 | .has-text-success .mdi-check { 279 | background-image: url('../img/check.svg'); 280 | } 281 | 282 | form { 283 | margin-bottom: 3rem; 284 | 285 | .button { 286 | padding: 12px 30px; 287 | font-weight: $weight-semibold; 288 | height: 50px; 289 | 290 | @include mobile { 291 | font-size: 14px; 292 | padding: 12px 14px; 293 | } 294 | } 295 | } 296 | 297 | .info { 298 | .heading { 299 | font-size: 14px; 300 | text-transform: none; 301 | margin-bottom: 0.5rem; 302 | } 303 | .title { 304 | color: #91ffbd; 305 | margin-bottom: 1.25rem; 306 | } 307 | .column:last-child { 308 | .title { 309 | margin-bottom: 0; 310 | } 311 | } 312 | } 313 | 314 | .wallets { 315 | margin: -0.5rem; 316 | 317 | &.field.is-grouped.is-grouped-multiline > .control { 318 | margin: 0.5rem; 319 | } 320 | 321 | .button { 322 | width: 120px; 323 | flex-direction: column; 324 | height: auto; 325 | 326 | &:before { 327 | content: ''; 328 | height: 64px; 329 | width: 64px; 330 | background-repeat: no-repeat; 331 | background-position: center; 332 | background-size: contain; 333 | margin: 0.25rem 0; 334 | } 335 | 336 | &.is-metamask:before { 337 | background-image: url('../img/metamask-fox.svg'); 338 | } 339 | 340 | &.is-portis:before { 341 | background-image: url('../img/portis.svg'); 342 | } 343 | 344 | &.is-authereum:before { 345 | background-image: url('../img/authereum.svg'); 346 | } 347 | 348 | &.is-walletconnect:before { 349 | background-image: url('../img/walletconnect.svg'); 350 | } 351 | 352 | &.is-mewconnect:before { 353 | background-image: url('../img/mewconnect.svg'); 354 | } 355 | } 356 | 357 | .control-with-select { 358 | .button { 359 | border-bottom-left-radius: 0; 360 | border-bottom-right-radius: 0; 361 | border-bottom-width: 0; 362 | 363 | &:before { 364 | height: 38px; 365 | } 366 | } 367 | 368 | .select { 369 | &.is-empty { 370 | select { 371 | color: rgba(255, 255, 255, 0.7); 372 | } 373 | } 374 | 375 | select { 376 | border-top-left-radius: 0; 377 | border-top-right-radius: 0; 378 | border-top-width: 0; 379 | background-color: $dark; 380 | 381 | &:hover { 382 | background-color: #2f2f2f; 383 | } 384 | 385 | &:focus { 386 | border-color: $dark; 387 | box-shadow: none; 388 | } 389 | } 390 | 391 | &:not(.is-multiple) { 392 | height: auto; 393 | 394 | &:not(.is-loading):hover::after { 395 | border-color: $primary; 396 | } 397 | } 398 | } 399 | } 400 | 401 | .network-select { 402 | width: 120px; 403 | overflow: hidden; 404 | } 405 | 406 | > .control:hover { 407 | .button { 408 | border-color: #fff; 409 | } 410 | 411 | &.control-with-select { 412 | .button { 413 | border-bottom-color: #363636; 414 | } 415 | 416 | .select select { 417 | border-color: #fff; 418 | } 419 | } 420 | } 421 | } 422 | 423 | .modal-card-title { 424 | width: 100%; 425 | text-align: center; 426 | } 427 | 428 | .fields:not(:last-child) { 429 | margin-bottom: 1.5rem; 430 | } 431 | 432 | .text-hide { 433 | font: 0/0 a; 434 | color: transparent; 435 | text-shadow: none; 436 | background-color: transparent; 437 | border: 0; 438 | } 439 | 440 | .logo { 441 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='156' height='40'%3E%3Cpath fill='%23FFF' fill-rule='evenodd' d='M92.076 25.742v-4.64c0-.746-.176-1.309-.528-1.688-.352-.378-.854-.568-1.504-.568-.736 0-1.318.222-1.744.664-.427.443-.64 1.08-.64 1.912v4.32h-2v-8.544h1.904v1.104c.33-.394.746-.693 1.248-.896.501-.202 1.066-.304 1.696-.304 1.077 0 1.941.315 2.592.944.65.63.976 1.563.976 2.8v4.896h-2zM77.004 22.11a2.32 2.32 0 0 0 .92 1.496c.496.368 1.112.552 1.848.552.938 0 1.712-.309 2.32-.928l1.072 1.232c-.384.459-.87.806-1.456 1.04-.587.235-1.248.352-1.984.352-.939 0-1.766-.186-2.48-.56a4.025 4.025 0 0 1-1.656-1.56c-.39-.666-.584-1.421-.584-2.264 0-.832.189-1.581.568-2.248a4.034 4.034 0 0 1 1.576-1.56c.672-.373 1.429-.56 2.272-.56.832 0 1.576.184 2.232.552a3.914 3.914 0 0 1 1.536 1.552c.368.667.552 1.438.552 2.312 0 .139-.011.336-.032.592h-6.704zm4.048-2.832c-.438-.384-.982-.576-1.632-.576-.64 0-1.182.19-1.624.568-.443.379-.712.883-.808 1.512h4.848c-.086-.618-.347-1.12-.784-1.504zm-8.72 6.464l-2.96-3.664-1.488 1.408v2.256h-2V13.87h2v7.168l4.144-3.84h2.4l-3.568 3.584 3.904 4.96h-2.432zm-10.576-.448c-.694.374-1.478.56-2.352.56-.864 0-1.643-.186-2.336-.56a4.072 4.072 0 0 1-1.624-1.56c-.39-.666-.584-1.421-.584-2.264 0-.842.194-1.594.584-2.256a4.1 4.1 0 0 1 1.624-1.552c.693-.373 1.472-.56 2.336-.56.874 0 1.658.187 2.352.56a4.113 4.113 0 0 1 1.624 1.552c.389.662.584 1.414.584 2.256 0 .843-.195 1.598-.584 2.264a4.085 4.085 0 0 1-1.624 1.56zm-.528-5.76c-.48-.49-1.088-.736-1.824-.736s-1.342.246-1.816.736c-.475.491-.712 1.136-.712 1.936s.237 1.446.712 1.936c.474.491 1.08.736 1.816.736s1.344-.245 1.824-.736c.48-.49.72-1.136.72-1.936s-.24-1.445-.72-1.936zm-9.872 6.208h-2.08v-9.44h-3.712v-1.76h9.504v1.76h-3.712v9.44z'/%3E%3Cpath fill='%2390FFBD' fill-rule='evenodd' d='M153.259 23.878c.203.219.496.328.88.328.448 0 .821-.117 1.12-.352l.56 1.424c-.235.192-.52.336-.856.432a3.857 3.857 0 0 1-1.064.144c-.939 0-1.664-.245-2.176-.736-.512-.49-.768-1.205-.768-2.144v-4.112h-1.408v-1.6h1.408V15.31h2v1.952h2.288v1.6h-2.288v4.064c0 .416.101.734.304.952zm-11.232-1.768a2.32 2.32 0 0 0 .92 1.496c.496.368 1.112.552 1.848.552.939 0 1.712-.309 2.32-.928l1.072 1.232a3.6 3.6 0 0 1-1.456 1.04c-.587.235-1.248.352-1.984.352-.939 0-1.765-.186-2.48-.56a4.025 4.025 0 0 1-1.656-1.56c-.389-.666-.584-1.421-.584-2.264 0-.832.189-1.581.568-2.248a4.04 4.04 0 0 1 1.576-1.56c.672-.373 1.429-.56 2.272-.56.832 0 1.576.184 2.232.552a3.914 3.914 0 0 1 1.536 1.552c.368.667.552 1.438.552 2.312 0 .139-.011.336-.032.592h-6.704zm4.048-2.832c-.437-.384-.981-.576-1.632-.576-.64 0-1.181.19-1.624.568-.443.379-.712.883-.808 1.512h4.848c-.085-.618-.347-1.12-.784-1.504zm-10.608 4.864c.437 0 .84-.098 1.208-.296.368-.197.675-.493.92-.888l1.536.896a3.458 3.458 0 0 1-1.448 1.48c-.635.347-1.368.52-2.2.52-.885 0-1.68-.186-2.384-.56a4.11 4.11 0 0 1-1.648-1.56c-.395-.666-.592-1.421-.592-2.264 0-.842.197-1.594.592-2.256a4.15 4.15 0 0 1 1.64-1.552c.699-.373 1.496-.56 2.392-.56.843 0 1.582.171 2.216.512a3.324 3.324 0 0 1 1.432 1.472l-1.536.896a2.447 2.447 0 0 0-.92-.888 2.52 2.52 0 0 0-1.208-.296c-.747 0-1.365.243-1.856.728-.491.486-.736 1.134-.736 1.944 0 .811.243 1.459.728 1.944.485.486 1.107.728 1.864.728zm-8.432.512c-.32.384-.72.68-1.2.888a3.86 3.86 0 0 1-1.552.312c-1.141 0-2.04-.317-2.696-.952-.656-.634-.984-1.576-.984-2.824v-4.88h2v4.608c0 .768.173 1.342.52 1.72.347.379.84.568 1.48.568.715 0 1.283-.221 1.704-.664.421-.442.632-1.08.632-1.912v-4.32h2v8.544h-1.904v-1.088zm-10.816.048a2.315 2.315 0 0 1-1.048.856c-.453.197-1 .296-1.64.296-.64 0-1.2-.109-1.68-.328-.48-.218-.85-.522-1.112-.912a2.315 2.315 0 0 1-.392-1.32c0-.768.286-1.384.856-1.848.571-.464 1.47-.696 2.696-.696h2.208v-.128c0-.597-.178-1.056-.536-1.376-.357-.32-.888-.48-1.592-.48-.48 0-.952.075-1.416.224-.464.15-.856.358-1.176.624l-.784-1.456c.448-.341.987-.602 1.616-.784a7.206 7.206 0 0 1 2-.272c1.259 0 2.222.302 2.888.904.667.603 1 1.512 1 2.728v5.008h-1.888v-1.04zm-.112-2.624h-2.064c-1.152 0-1.728.379-1.728 1.136 0 .363.144.651.432.864.288.214.688.32 1.2.32.502 0 .947-.114 1.336-.344.39-.229.664-.557.824-.984v-.992zm-12.8-2.384h5.408v1.76h-5.408v4.288h-2.08v-11.2h8.176v1.744h-6.096v3.408z'/%3E%3Cpath fill='%23FFF' fill-rule='evenodd' d='M29 20h-9v9a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-9H1a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h9V1a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v9h9a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1z'/%3E%3Cpath fill='%2390FFBD' fill-rule='evenodd' d='M21 30h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z'/%3E%3C/svg%3E"); 442 | } 443 | -------------------------------------------------------------------------------- /front/components/Modal.vue: -------------------------------------------------------------------------------- 1 | 52 | 86 | -------------------------------------------------------------------------------- /front/components/NetworkSelect.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 43 | -------------------------------------------------------------------------------- /front/components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | The components directory contains your Vue.js Components. 6 | 7 | _Nuxt.js doesn't supercharge these components._ 8 | -------------------------------------------------------------------------------- /front/gulpfile.js: -------------------------------------------------------------------------------- 1 | const { src, dest } = require('gulp') 2 | const htmlmin = require('gulp-html-minifier') 3 | 4 | function minify() { 5 | return src('./dist/**/*.html') 6 | .pipe(htmlmin({ removeComments: true, collapseWhitespace: true })) 7 | .pipe(dest('./dist')) 8 | } 9 | 10 | exports.default = minify 11 | -------------------------------------------------------------------------------- /front/layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Application Layouts. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). 8 | -------------------------------------------------------------------------------- /front/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 37 | -------------------------------------------------------------------------------- /front/layouts/error.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 42 | 43 | 65 | -------------------------------------------------------------------------------- /front/middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your application middleware. 6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages. 7 | 8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). 9 | -------------------------------------------------------------------------------- /front/netlify.toml: -------------------------------------------------------------------------------- 1 | # [[redirects]] 2 | # from = "/*" 3 | # to = "/451" 4 | # status = 451 5 | # force = true 6 | # conditions = {Country=["RU", "BY","CU","IR","IQ","CI","LR","KP","SD","SY","ZW"]} 7 | -------------------------------------------------------------------------------- /front/networkConfig.js: -------------------------------------------------------------------------------- 1 | const networkConfig = { 2 | netId1: { 3 | verifyingContract: '0xfab46e002bbf0b4509813474841e0716e6730136', 4 | rpcCallRetryAttempt: 10, 5 | currencyName: 'ETH', 6 | explorerUrl: { 7 | tx: 'https://etherscan.io/tx', 8 | address: 'https://etherscan.io/address' 9 | }, 10 | networkName: 'Mainnet', 11 | rpcUrl: `https://mainnet.infura.io/v3/${process.env.infuraId}`, 12 | gasPrice: { fast: 21, low: 1, standard: 5 }, 13 | smartContractPollTime: 15, 14 | isEIP1559Supported: true 15 | }, 16 | netId3: { 17 | verifyingContract: '0xfab46e002bbf0b4509813474841e0716e6730136', 18 | rpcCallRetryAttempt: 10, 19 | currencyName: 'rETH', 20 | explorerUrl: { 21 | tx: 'https://ropsten.etherscan.io/tx', 22 | address: 'https://ropsten.etherscan.io/address' 23 | }, 24 | networkName: 'Ropsten', 25 | rpcUrl: `https://ropsten.infura.io/v3/${process.env.infuraId}`, 26 | gasPrice: { fast: 1, low: 1, standard: 1 }, 27 | smartContractPollTime: 15, 28 | isEIP1559Supported: true 29 | }, 30 | netId4: { 31 | verifyingContract: '0xfab46e002bbf0b4509813474841e0716e6730136', 32 | rpcCallRetryAttempt: 10, 33 | currencyName: 'RETH', 34 | explorerUrl: { 35 | tx: 'https://rinkeby.etherscan.io/tx', 36 | address: 'https://rinkeby.etherscan.io/address' 37 | }, 38 | networkName: 'Rinkeby', 39 | rpcUrl: `https://rinkeby.infura.io/v3/${process.env.infuraId}`, 40 | gasPrice: { fast: 1, low: 1, standard: 1 }, 41 | smartContractPollTime: 15, 42 | isEIP1559Supported: true 43 | }, 44 | netId5: { 45 | verifyingContract: '0xBA62BCfcAaFc6622853cca2BE6Ac7d845BC0f2Dc', 46 | rpcCallRetryAttempt: 10, 47 | currencyName: 'GöETH', 48 | explorerUrl: { 49 | tx: 'https://goerli.etherscan.io/tx', 50 | address: 'https://goerli.etherscan.io/address' 51 | }, 52 | networkName: 'Goerli', 53 | rpcUrl: `https://goerli.infura.io/v3/${process.env.infuraId}`, 54 | gasPrice: { fast: 1, low: 1, standard: 1 }, 55 | smartContractPollTime: 15, 56 | isEIP1559Supported: true 57 | }, 58 | netId42: { 59 | verifyingContract: '0xfab46e002bbf0b4509813474841e0716e6730136', 60 | rpcCallRetryAttempt: 10, 61 | currencyName: 'kETH', 62 | explorerUrl: { 63 | tx: 'https://kovan.etherscan.io/tx', 64 | address: 'https://kovan.etherscan.io/address' 65 | }, 66 | networkName: 'Kovan', 67 | rpcUrl: `https://kovan.infura.io/v3/${process.env.infuraId}`, 68 | gasPrice: { fast: 1, low: 1, standard: 1 }, 69 | smartContractPollTime: 15, 70 | isEIP1559Supported: true 71 | }, 72 | netId10: { 73 | verifyingContract: '0x5c239f4E539452f58A55E3d5Be1dC016b0809a19', 74 | rpcCallRetryAttempt: 10, 75 | currencyName: 'ETH', 76 | explorerUrl: { 77 | tx: 'https://optimistic.etherscan.io/tx', 78 | address: 'https://optimistic.etherscan.io/address' 79 | }, 80 | networkName: 'Optimism', 81 | rpcUrl: `https://mainnet.optimism.io`, 82 | gasPrice: { fast: 0.001, low: 0.001, standard: 0.001 }, 83 | smartContractPollTime: 15, 84 | isEIP1559Supported: false 85 | }, 86 | netId99: { 87 | verifyingContract: '0x8dc4f704a5fdf9f09ed561381bd02187201a83b8', 88 | rpcCallRetryAttempt: 10, 89 | currencyName: 'POA', 90 | explorerUrl: { 91 | tx: 'https://blockscout.com/poa/core/tx', 92 | address: 'https://blockscout.com/poa/core/address' 93 | }, 94 | networkName: 'POA', 95 | rpcUrl: 'https://core.poa.network', 96 | gasPrice: { fast: 1, low: 1, standard: 1 }, 97 | smartContractPollTime: 15, 98 | isEIP1559Supported: false 99 | }, 100 | netId100: { 101 | verifyingContract: '0x3111c94b9243a8a99d5a867e00609900e437e2c0', 102 | rpcCallRetryAttempt: 10, 103 | currencyName: 'xDai', 104 | explorerUrl: { 105 | tx: 'https://blockscout.com/xdai/mainnet/tx', 106 | address: 'https://blockscout.com/xdai/mainnet/address' 107 | }, 108 | networkName: 'Gnosis Chain (formerly xDai)', 109 | rpcUrl: 'https://dai.poa.network', 110 | gasPrice: { fast: 1, low: 1, standard: 1 }, 111 | smartContractPollTime: 15, 112 | isEIP1559Supported: false 113 | }, 114 | netId77: { 115 | verifyingContract: '0x3b6578d5a24e16010830bf6443bc9223d6b53480', 116 | rpcCallRetryAttempt: 10, 117 | currencyName: 'SPOA', 118 | explorerUrl: { 119 | tx: 'https://blockscout.com/poa/sokol/tx', 120 | address: 'https://blockscout.com/poa/sokol/address' 121 | }, 122 | networkName: 'Sokol', 123 | rpcUrl: 'https://sokol.poa.network', 124 | gasPrice: { fast: 1, low: 1, standard: 1 }, 125 | smartContractPollTime: 15, 126 | isEIP1559Supported: false 127 | }, 128 | netId56: { 129 | verifyingContract: '0x5CD5Bb3EC13CE31771b63632Ddc2EB36E300b96C', 130 | rpcCallRetryAttempt: 10, 131 | currencyName: 'BNB', 132 | explorerUrl: { 133 | tx: 'https://bscscan.com/tx', 134 | address: 'https://bscscan.com/address' 135 | }, 136 | networkName: 'BNB Smart Chain', 137 | rpcUrl: 'https://bsc-dataseed1.binance.org', 138 | gasPrice: { fast: 20, low: 20, standard: 20 }, 139 | smartContractPollTime: 15, 140 | isEIP1559Supported: false 141 | }, 142 | netId43114: { 143 | verifyingContract: '0xb816d2Bd3FFEf8CA2E65E5F7E0695351b733C4f3', 144 | rpcCallRetryAttempt: 10, 145 | currencyName: 'AVAX', 146 | explorerUrl: { 147 | tx: 'https://snowtrace.io/tx', 148 | address: 'https://snowtrace.io/address' 149 | }, 150 | networkName: 'Avalanche C Chain', 151 | rpcUrl: 'https://api.avax.network/ext/bc/C/rpc', 152 | gasPrice: { fast: 35, low: 25, custom: 25, standard: 25 }, 153 | smartContractPollTime: 15, 154 | isEIP1559Supported: false 155 | }, 156 | netId250: { 157 | verifyingContract: '0x5CD5Bb3EC13CE31771b63632Ddc2EB36E300b96C', 158 | rpcCallRetryAttempt: 10, 159 | currencyName: 'FTM', 160 | explorerUrl: { 161 | tx: 'https://ftmscan.com/tx', 162 | address: 'https://ftmscan.com/address' 163 | }, 164 | networkName: 'Fantom Opera', 165 | rpcUrl: 'https://rpcapi.fantom.network', 166 | gasPrice: { fast: 22, low: 22, standard: 22 }, 167 | smartContractPollTime: 15, 168 | isEIP1559Supported: false 169 | }, 170 | netId137: { 171 | verifyingContract: '0xb816d2Bd3FFEf8CA2E65E5F7E0695351b733C4f3', 172 | rpcCallRetryAttempt: 10, 173 | currencyName: 'MATIC', 174 | explorerUrl: { 175 | tx: 'https://polygonscan.com/tx', 176 | address: 'https://polygonscan.com/address' 177 | }, 178 | networkName: 'Polygon(Matic) Network', 179 | rpcUrl: 'https://rpc-mainnet.maticvigil.com', 180 | gasPrice: { fast: 1, low: 1, standard: 1 }, 181 | smartContractPollTime: 15, 182 | isEIP1559Supported: false 183 | }, 184 | netId4689: { 185 | verifyingContract: '0x02D61e81A645093237C7e38200E16B78e1602Db3', 186 | rpcCallRetryAttempt: 10, 187 | currencyName: 'IOTX', 188 | explorerUrl: { 189 | tx: 'https://iotexscan.io/action', 190 | address: 'https://iotexscan.io/address' 191 | }, 192 | networkName: 'IoTeX', 193 | rpcUrl: 'https://babel-api.mainnet.iotex.io', 194 | gasPrice: { fast: 1000, low: 1000, custom: 1000, standard: 1000 }, 195 | smartContractPollTime: 15, 196 | isEIP1559Supported: false 197 | }, 198 | netId1285: { 199 | verifyingContract: '0xf19aCf82eA96ab197139852cb81e726bd6ddf882', 200 | rpcCallRetryAttempt: 10, 201 | currencyName: 'MOVR', 202 | explorerUrl: { 203 | tx: 'https://moonriver.moonscan.io/tx', 204 | address: 'https://moonriver.moonscan.io/address' 205 | }, 206 | networkName: 'Moonriver', 207 | rpcUrl: 'https://rpc.moonriver.moonbeam.network', 208 | gasPrice: { fast: 1, low: 1, custom: 1, standard: 1 }, 209 | smartContractPollTime: 15, 210 | isEIP1559Supported: false 211 | }, 212 | netId42161: { 213 | verifyingContract: '0x84952D54882614C392Baeff5CB0332CC551ca119', 214 | rpcCallRetryAttempt: 10, 215 | currencyName: 'ETH', 216 | explorerUrl: { 217 | tx: 'https://arbiscan.io/tx', 218 | address: 'https://arbiscan.io/address' 219 | }, 220 | networkName: 'Arbitrum One', 221 | rpcUrl: 'https://arb1.arbitrum.io/rpc', 222 | gasPrice: { fast: 1.456826792, low: 1.456826792, custom: 1.456826792, standard: 1.456826792 }, 223 | smartContractPollTime: 15, 224 | isEIP1559Supported: false 225 | }, 226 | netId421611: { 227 | verifyingContract: '0x9f95e683fa8f4824fe9f2c8e740809d71b073f4b', 228 | rpcCallRetryAttempt: 10, 229 | currencyName: 'ETH', 230 | explorerUrl: { 231 | tx: 'https://rinkeby-explorer.arbitrum.io/tx', 232 | address: 'https://rinkeby-explorer.arbitrum.io/address' 233 | }, 234 | networkName: 'Arbitrum Testnet Rinkeby', 235 | rpcUrl: 'https://rinkeby.arbitrum.io/rpc', 236 | gasPrice: { fast: 0.0202, low: 0.0202, custom: 0.0202, standard: 0.0202 }, 237 | smartContractPollTime: 15, 238 | isEIP1559Supported: false 239 | }, 240 | netId25: { 241 | verifyingContract: '0xb94c3fC62B605B1C587EA5D53cc218eD9b5a6C1C', 242 | rpcCallRetryAttempt: 10, 243 | currencyName: 'CRO', 244 | explorerUrl: { 245 | tx: 'https://cronos.crypto.org/explorer/tx', 246 | address: 'https://cronos.crypto.org/explorer/address' 247 | }, 248 | networkName: 'Cronos', 249 | rpcUrl: 'https://evm.crypto.org', 250 | gasPrice: { fast: 6000, low: 4500, custom: 6000, standard: 4500 }, 251 | smartContractPollTime: 15, 252 | isEIP1559Supported: false 253 | }, 254 | netId128: { 255 | verifyingContract: '0xC4fc619bBa4572656606bc7Fdc0874d481EBebDE', 256 | rpcCallRetryAttempt: 10, 257 | currencyName: 'HT', 258 | explorerUrl: { 259 | tx: 'https://hecoinfo.com/tx', 260 | address: 'https://hecoinfo.com/address' 261 | }, 262 | networkName: 'Huobi ECO Chain', 263 | rpcUrl: 'https://http-mainnet.hecochain.com', 264 | gasPrice: { fast: 5, low: 1, custom: 3, standard: 1 }, 265 | smartContractPollTime: 15, 266 | isEIP1559Supported: false 267 | }, 268 | netId66: { 269 | verifyingContract: '0xC4fc619bBa4572656606bc7Fdc0874d481EBebDE', 270 | rpcCallRetryAttempt: 10, 271 | currencyName: 'OKT', 272 | explorerUrl: { 273 | tx: 'https://www.oklink.com/oec/tx', 274 | address: 'https://www.oklink.com/oec/address' 275 | }, 276 | networkName: 'OKExChain', 277 | rpcUrl: 'https://exchainrpc.okex.org', 278 | gasPrice: { fast: 10, low: 1, custom: 3, standard: 1 }, 279 | smartContractPollTime: 15, 280 | isEIP1559Supported: false 281 | }, 282 | netId321: { 283 | verifyingContract: '0xC4fc619bBa4572656606bc7Fdc0874d481EBebDE', 284 | rpcCallRetryAttempt: 10, 285 | currencyName: 'KCS', 286 | explorerUrl: { 287 | tx: 'https://explorer.kcc.io/en/tx', 288 | address: 'https://explorer.kcc.io/en/address' 289 | }, 290 | networkName: 'KCC Mainnet', 291 | rpcUrl: 'https://rpc-mainnet.kcc.network', 292 | gasPrice: { fast: 10, low: 1, custom: 2, standard: 1 }, 293 | smartContractPollTime: 15, 294 | isEIP1559Supported: false 295 | }, 296 | netId42220: { 297 | verifyingContract: '0xC4fc619bBa4572656606bc7Fdc0874d481EBebDE', 298 | rpcCallRetryAttempt: 10, 299 | currencyName: 'CELO', 300 | explorerUrl: { 301 | tx: 'https://explorer.celo.org/tx', 302 | address: 'https://explorer.celo.org/address' 303 | }, 304 | networkName: 'Celo', 305 | rpcUrl: 'https://forno.celo.org', 306 | gasPrice: { fast: 2, low: 0.1, custom: 1, standard: 1 }, 307 | smartContractPollTime: 15, 308 | isEIP1559Supported: false 309 | }, 310 | netId1666600000: { 311 | verifyingContract: '0x6fee5953b581b8496E63c73374c32a0A7F9350B4', 312 | rpcCallRetryAttempt: 10, 313 | currencyName: 'ONE', 314 | explorerUrl: { 315 | tx: 'https://explorer.harmony.one/tx', 316 | address: 'https://explorer.harmony.one/address' 317 | }, 318 | networkName: 'Harmony Mainnet', 319 | rpcUrl: 'https://api.harmony.one', 320 | gasPrice: { fast: 5, low: 1, custom: 2, standard: 1 }, 321 | smartContractPollTime: 15, 322 | isEIP1559Supported: false 323 | }, 324 | netId55: { 325 | verifyingContract: '0x2299D9fE56488d7b3EAFA4a1E7a081c8Eb4c4b0a', 326 | rpcCallRetryAttempt: 10, 327 | currencyName: 'ZYX', 328 | explorerUrl: { 329 | tx: 'https://zyxscan.com/tx', 330 | address: 'https://zyxscan.com/address' 331 | }, 332 | networkName: 'Zyx', 333 | rpcUrl: 'https://rpc-1.zyx.network/', 334 | gasPrice: { fast: 15, low: 9, custom: 10, standard: 10 }, 335 | smartContractPollTime: 15, 336 | isEIP1559Supported: false 337 | }, 338 | netId40: { 339 | verifyingContract: '0xC4fc619bBa4572656606bc7Fdc0874d481EBebDE', 340 | rpcCallRetryAttempt: 10, 341 | currencyName: 'TLOS', 342 | explorerUrl: { 343 | tx: 'https://www.teloscan.io/evm/transaction', 344 | address: 'https://www.teloscan.io/evm/address' 345 | }, 346 | networkName: 'Telos EVM', 347 | rpcUrl: 'https://mainnet.telos.net/evm', 348 | gasPrice: { fast: 600, low: 499.9, custom: 500, standard: 499.9 }, 349 | smartContractPollTime: 15, 350 | isEIP1559Supported: false 351 | }, 352 | netId1284: { 353 | verifyingContract: '0xC4fc619bBa4572656606bc7Fdc0874d481EBebDE', 354 | rpcCallRetryAttempt: 10, 355 | currencyName: 'GLMR', 356 | explorerUrl: { 357 | tx: 'https://moonbeam.moonscan.io/tx', 358 | address: 'https://moonbeam.moonscan.io/address' 359 | }, 360 | networkName: 'Moonbeam', 361 | rpcUrl: 'https://rpc.api.moonbeam.network', 362 | gasPrice: { fast: 100, low: 100, custom: 100, standard: 100 }, 363 | smartContractPollTime: 15, 364 | isEIP1559Supported: false 365 | }, 366 | netId1088: { 367 | verifyingContract: '0x0C3f22c3AFc5D222c4f6B34Ef901D468B1866948', 368 | rpcCallRetryAttempt: 10, 369 | currencyName: 'Metis', 370 | explorerUrl: { 371 | tx: 'https://andromeda-explorer.metis.io/tx', 372 | address: 'https://andromeda-explorer.metis.io/address' 373 | }, 374 | networkName: 'Metis', 375 | rpcUrl: 'https://andromeda.metis.io/?owner=1088', 376 | gasPrice: { fast: 8, low: 8, custom: 8, standard: 8 }, 377 | smartContractPollTime: 15, 378 | isEIP1559Supported: false 379 | }, 380 | netId1313161554: { 381 | verifyingContract: '0xb94c3fC62B605B1C587EA5D53cc218eD9b5a6C1C', 382 | rpcCallRetryAttempt: 10, 383 | currencyName: 'ETH', 384 | explorerUrl: { 385 | tx: 'https://aurorascan.dev/tx', 386 | address: 'https://aurorascan.dev/address' 387 | }, 388 | networkName: 'Aurora', 389 | rpcUrl: 'https://mainnet.aurora.dev', 390 | gasPrice: { fast: 0.5, low: 0.01, custom: 0.3, standard: 0.05 }, 391 | smartContractPollTime: 15, 392 | isEIP1559Supported: false 393 | }, 394 | netId108: { 395 | verifyingContract: '0x4e96Ae2DE48AB986B496942533E6aF3Ee9C275a5', 396 | rpcCallRetryAttempt: 10, 397 | currencyName: 'TT', 398 | explorerUrl: { 399 | tx: 'https://scan.thundercore.com/transactions', 400 | address: 'https://scan.thundercore.com/address' 401 | }, 402 | networkName: 'ThunderCore', 403 | rpcUrl: 'https://mainnet-rpc.thundercore.com', 404 | gasPrice: { fast: 20, low: 2, custom: 2, standard: 1 }, 405 | smartContractPollTime: 15, 406 | isEIP1559Supported: false 407 | }, 408 | netId79: { 409 | verifyingContract: '0x601280b038d8663204D2E7869730D67d061665Fa', 410 | rpcCallRetryAttempt: 15, 411 | currencyName: 'ZENITH', 412 | explorerUrl: { 413 | tx: 'https://scan.zenithchain.co/tx', 414 | address: 'https://scan.zenithchain.co/address' 415 | }, 416 | networkName: 'Zenith Mainnet', 417 | rpcUrl: 'https://dataserver-1.zenithchain.co', 418 | gasPrice: { fast: 5, low: 1, custom: 2, standard: 1.5 }, 419 | smartContractPollTime: 15, 420 | isEIP1559Supported: false 421 | } 422 | } 423 | 424 | export default networkConfig 425 | -------------------------------------------------------------------------------- /front/nuxt.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | require('dotenv').config() 3 | const modifyHtml = (html) => { 4 | return html.replace(/data-n-head=""|data-n-head="true"/g, '') 5 | } 6 | 7 | const modules = [ 8 | ['nuxt-buefy', { css: false, materialDesignIcons: false }], 9 | ['nuxt-validate', { events: '' }], 10 | 'nuxt-web3-provider' 11 | ] 12 | if (process.env.NODE_ENV !== 'development') { 13 | modules.push([ 14 | '@nuxtjs/google-analytics', 15 | { 16 | id: 'UA-61981520-6' 17 | } 18 | ]) 19 | } 20 | 21 | export default { 22 | target: 'static', 23 | ssr: false, 24 | render: { resourceHints: false }, 25 | generate: { 26 | fallback: true 27 | }, 28 | /* 29 | ** Headers of the page 30 | */ 31 | hooks: { 32 | 'generate:page': (page) => { 33 | page.html = modifyHtml(page.html) 34 | }, 35 | 'render:route': (url, page, { req, res }) => { 36 | page.html = modifyHtml(page.html) 37 | } 38 | }, 39 | head: { 40 | htmlAttrs: { 41 | lang: 'en' 42 | }, 43 | title: 'ERC20 Token Faucet', 44 | meta: [ 45 | { charset: 'utf-8' }, 46 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 47 | { 48 | hid: 'description', 49 | name: 'description', 50 | content: 51 | 'An ERC20 token faucet on the Ethereum mainnet, and Ropsten, Kovan, Rinkeby and Görli testnets.' 52 | }, 53 | { 54 | hid: 'og:title', 55 | property: 'og:title', 56 | content: 'ERC20 Faucet Dapp Smart Contract' 57 | }, 58 | { 59 | hid: 'og:description', 60 | property: 'og:description', 61 | content: 'Get free ERC20 token on any Ethereum network' 62 | }, 63 | { 64 | hid: 'og:url', 65 | property: 'og:url', 66 | content: 'https://erc20faucet.com' 67 | }, 68 | { 69 | hid: 'og:type', 70 | property: 'og:type', 71 | content: 'website' 72 | }, 73 | { 74 | hid: 'og:image', 75 | property: 'og:image', 76 | content: 'https://erc20faucet.com/fb.png' 77 | }, 78 | { 79 | hid: 'description', 80 | name: 'description', 81 | content: 'Get free ERC20 token on any Ethereum network' 82 | }, 83 | { 84 | hid: 'keywords', 85 | name: 'keywords', 86 | content: 87 | 'Airdrop, ERC20 Ethereum, free erc20, erc20 faucet, dapp, smart contract, decentralized, metamask' 88 | } 89 | ], 90 | link: [ 91 | { rel: 'shortcut icon', type: 'image/x-icon', href: 'favicon.ico' }, 92 | { rel: 'icon', type: 'image/png', href: 'apple-touch-icon-180x180.png' }, 93 | { rel: 'apple-touch-icon', href: 'apple-touch-icon-180x180.png' }, 94 | { 95 | rel: 'stylesheet', 96 | href: 'https://fonts.googleapis.com/css?family=Montserrat:400,600,700' 97 | } 98 | ], 99 | script: [ 100 | { 101 | src: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', 102 | async: '' 103 | } 104 | ] 105 | }, 106 | 107 | /* 108 | ** Customize the progress-bar color 109 | */ 110 | loading: { color: '#90ffbd' }, 111 | 112 | loadingIndicator: { 113 | color: '#90ffbd', 114 | background: '#000403' 115 | }, 116 | 117 | // ...routerBase, 118 | // router: { 119 | // base: '/erc20faucet/' 120 | // }, 121 | 122 | /* 123 | ** Global CSS 124 | */ 125 | css: ['@/assets/styles/styles.scss'], 126 | 127 | /* 128 | ** Plugins to load before mounting the App 129 | */ 130 | plugins: [{ src: '~/plugins/ads.js', ssr: false }], 131 | 132 | /* 133 | ** Nuxt.js modules 134 | */ 135 | modules, 136 | 137 | providers: { 138 | rpcUrl: 'https://mainnet.infura.io/v3/c7463beadf2144e68646ff049917b716' 139 | }, 140 | 141 | env: { 142 | infuraId: process.env.INFURA_ID || 'c7463beadf2144e68646ff049917b716' 143 | }, 144 | 145 | /* 146 | ** Build configuration 147 | */ 148 | build: { 149 | /* 150 | ** You can extend webpack config here 151 | */ 152 | extend(config, ctx) { 153 | // Run ESLint on save 154 | if (ctx.isDev && ctx.isClient) { 155 | config.module.rules.push({ 156 | enforce: 'pre', 157 | test: /\.(js|vue)$/, 158 | loader: 'eslint-loader', 159 | exclude: /(node_modules)/ 160 | }) 161 | } 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /front/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "front", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "nuxt", 7 | "build": "nuxt build", 8 | "start": "nuxt start", 9 | "generate": "nuxt generate && gulp", 10 | "lint": "eslint --ext .js,.vue --ignore-path .gitignore .", 11 | "precommit": "npm run lint", 12 | "deploy": "echo erc20faucet.com > static/CNAME && yarn generate && push-dir --remote origin --dir=dist --branch=gh-pages --cleanup" 13 | }, 14 | "dependencies": { 15 | "@mycrypto/gas-estimation": "^1.1.0", 16 | "@myetherwallet/mewconnect-web-client": "^2.1.22", 17 | "@nuxtjs/google-analytics": "^2.2.0", 18 | "@portis/web3": "^2.0.0-beta.38", 19 | "@walletconnect/web3-provider": "^1.3.3", 20 | "authereum": "^0.0.4-beta.110", 21 | "cross-env": "^5.2.0", 22 | "dotenv": "8.2.0", 23 | "gas-price-oracle": "^0.4.4", 24 | "gulp": "^4.0.2", 25 | "gulp-html-minifier": "^0.1.8", 26 | "nuxt": "2.14.7", 27 | "nuxt-buefy": "^0.3.4", 28 | "nuxt-validate": "^0.1.2", 29 | "nuxt-web3-provider": "0.1.2", 30 | "push-dir": "^0.4.1", 31 | "remove-html-comments": "^1.0.2", 32 | "web3": "1.0.0-beta.36" 33 | }, 34 | "devDependencies": { 35 | "@nuxtjs/eslint-config": "^0.0.1", 36 | "babel-eslint": "^10.0.1", 37 | "eslint": "^5.15.1", 38 | "eslint-config-standard": ">=12.0.0", 39 | "eslint-loader": "^2.1.2", 40 | "eslint-plugin-import": ">=2.16.0", 41 | "eslint-plugin-jest": ">=22.3.0", 42 | "eslint-plugin-node": ">=8.0.1", 43 | "eslint-plugin-nuxt": ">=0.4.2", 44 | "eslint-plugin-promise": ">=4.0.1", 45 | "eslint-plugin-standard": ">=4.0.0", 46 | "eslint-plugin-vue": "^5.2.2", 47 | "node-sass": "^4.13.1", 48 | "nodemon": "^1.18.9", 49 | "sass-loader": "^7.1.0" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /front/pages/451.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /front/pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the `*.vue` files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). 7 | -------------------------------------------------------------------------------- /front/pages/index.vue: -------------------------------------------------------------------------------- 1 | 123 | 124 | 228 | -------------------------------------------------------------------------------- /front/plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). 8 | -------------------------------------------------------------------------------- /front/plugins/ads.js: -------------------------------------------------------------------------------- 1 | (window.adsbygoogle = window.adsbygoogle || []).push({ 2 | google_ad_client: 'ca-pub-1055897217196742', 3 | enable_page_level_ads: true 4 | }) 5 | -------------------------------------------------------------------------------- /front/services/estimateGas.js: -------------------------------------------------------------------------------- 1 | import { numberToHex, BN } from 'web3-utils' 2 | import { estimateFees as estimate } from '@mycrypto/gas-estimation' 3 | 4 | export async function estimateFees(rpcUrl) { 5 | const { maxFeePerGas, maxPriorityFeePerGas } = await estimate(rpcUrl) 6 | 7 | return { 8 | maxFeePerGas: numberToHex(new BN(maxFeePerGas).toNumber()), 9 | maxPriorityFeePerGas: numberToHex(new BN(maxPriorityFeePerGas).toNumber()) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /front/services/gasOracle.js: -------------------------------------------------------------------------------- 1 | import { GasPriceOracle } from 'gas-price-oracle' 2 | 3 | const SECONDS = 3 4 | const TIMEOUT = SECONDS * 1000 5 | 6 | export async function getGasPrice(chainId, rpcUrl, defaultFallbackGasPrices) { 7 | const instance = new GasPriceOracle({ chainId, timeout: TIMEOUT, defaultRpc: rpcUrl, defaultFallbackGasPrices }) 8 | const result = await instance.gasPrices() 9 | 10 | return result 11 | } 12 | -------------------------------------------------------------------------------- /front/services/index.js: -------------------------------------------------------------------------------- 1 | export * from './gasOracle' 2 | export * from './estimateGas' 3 | -------------------------------------------------------------------------------- /front/static/CNAME: -------------------------------------------------------------------------------- 1 | erc20faucet.com 2 | -------------------------------------------------------------------------------- /front/static/ERC20 Token Faucet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peppersec/erc20faucet/b06d26a892ea2cc1d3ba69924f1f199b606bbaaf/front/static/ERC20 Token Faucet.jpg -------------------------------------------------------------------------------- /front/static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your static files. 6 | Each file inside this directory is mapped to `/`. 7 | Thus you'd want to delete this README.md before deploying to production. 8 | 9 | Example: `/static/robots.txt` is mapped as `/robots.txt`. 10 | 11 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). 12 | -------------------------------------------------------------------------------- /front/static/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peppersec/erc20faucet/b06d26a892ea2cc1d3ba69924f1f199b606bbaaf/front/static/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /front/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peppersec/erc20faucet/b06d26a892ea2cc1d3ba69924f1f199b606bbaaf/front/static/favicon.ico -------------------------------------------------------------------------------- /front/static/fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peppersec/erc20faucet/b06d26a892ea2cc1d3ba69924f1f199b606bbaaf/front/static/fb.png -------------------------------------------------------------------------------- /front/store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory automatically activates the option in the framework. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /front/store/gasPrice.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | import { toWei, toHex } from 'web3-utils' 4 | import { getGasPrice, estimateFees } from '../services' 5 | 6 | const actions = { 7 | async fetchGasPrice({ rootGetters }) { 8 | try { 9 | const netId = rootGetters['metamask/netId'] 10 | const networkConfig = rootGetters['metamask/networkConfig'] 11 | 12 | const gasPrices = await getGasPrice(netId, networkConfig.rpcUrl, networkConfig.gasPrice) 13 | return toHex(toWei(gasPrices.fast.toString(), 'gwei')) 14 | } catch (err) { 15 | throw new Error(err.message) 16 | } 17 | }, 18 | async gasWatcher({ commit, dispatch, rootGetters }) { 19 | const TIME_OUT = 15 20 | const networkConfig = rootGetters['metamask/networkConfig'] 21 | 22 | try { 23 | if (networkConfig.isEIP1559Supported) { 24 | const { maxFeePerGas, maxPriorityFeePerGas } = await estimateFees(networkConfig.rpcUrl) 25 | 26 | commit('SET_GAS_PARAMS', { maxFeePerGas, maxPriorityFeePerGas }) 27 | } else { 28 | const gasPrice = await dispatch('fetchGasPrice') 29 | 30 | commit('SET_GAS_PARAMS', { gasPrice }) 31 | } 32 | } catch (err) { 33 | commit('SET_GAS_PARAMS', { gasPrice: networkConfig.gasPrice.fast }) 34 | console.log('Get gas price error: ', err.message) 35 | } finally { 36 | setTimeout(() => dispatch('gasWatcher'), TIME_OUT * 1000) 37 | } 38 | } 39 | } 40 | 41 | const mutations = { 42 | SET_GAS_PARAMS(state, gasParams) { 43 | state.gasParams = gasParams 44 | } 45 | } 46 | 47 | const getters = {} 48 | 49 | const state = () => { 50 | return { 51 | gasParams: {} 52 | } 53 | } 54 | 55 | export default { 56 | namespaced: true, 57 | state, 58 | getters, 59 | mutations, 60 | actions 61 | } 62 | -------------------------------------------------------------------------------- /front/store/metamask.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | import Portis from '@portis/web3' 3 | import MewConnect from '@myetherwallet/mewconnect-web-client' 4 | import WalletConnectProvider from '@walletconnect/web3-provider' 5 | import { toChecksumAddress, fromWei, isAddress } from 'web3-utils' 6 | import networkConfig from '@/networkConfig' 7 | let Authereum 8 | if (process.client) { 9 | Authereum = require('authereum').Authereum 10 | } 11 | 12 | const onAccountsChanged = ({ newAccount, commit }) => { 13 | const account = toChecksumAddress(newAccount[0]) 14 | commit('IDENTIFY', account) 15 | } 16 | 17 | const state = () => { 18 | return { 19 | ethAccount: null, 20 | netId: 1, 21 | domainData: {}, 22 | balance: '0', 23 | address: { 24 | value: null, 25 | valid: false 26 | }, 27 | providerName: '', 28 | networkName: '', 29 | initProvider: false 30 | } 31 | } 32 | 33 | const getters = { 34 | netId(state) { 35 | return state.netId 36 | }, 37 | networkName(state) { 38 | return networkConfig[`netId${state.netId}`].networkName 39 | }, 40 | currency(state) { 41 | return networkConfig[`netId${state.netId}`].currencyName 42 | }, 43 | networkConfig(state) { 44 | return networkConfig[`netId${state.netId}`] 45 | }, 46 | getEthereumProvider: (state) => { 47 | const { providerName, networkName } = state 48 | switch (providerName) { 49 | case 'portis': 50 | if (window.portis) { 51 | return window.portis.provider 52 | } else { 53 | window.portis = new Portis('f21d6ef4-efe2-4005-a7b2-817b7d6332a4', networkName) 54 | return window.portis.provider 55 | } 56 | case 'authereum': 57 | const authereum = new Authereum(networkName) 58 | return authereum.getProvider() 59 | case 'mewconnect': 60 | if (window.connectMew) return window.connectMew 61 | const connect = new MewConnect.Provider({ windowClosedError: true, infuraId: process.env.infuraId }) 62 | window.connectMew = connect.makeWeb3Provider(networkName) 63 | window.connectMew.sendAsync = new Proxy(window.connectMew.sendAsync, { 64 | apply(target, thisArg, argumentsList) { 65 | if (argumentsList.length >= 1) { 66 | if (!argumentsList[0].id && typeof argumentsList === 'object') { 67 | argumentsList[0].id = Date.now() 68 | } 69 | } 70 | return target(...argumentsList) 71 | } 72 | }) 73 | return window.connectMew 74 | case 'walletconnect': 75 | const walletconnect = new WalletConnectProvider({ 76 | infuraId: process.env.infuraId 77 | }) 78 | 79 | return walletconnect 80 | 81 | // case 'torus': 82 | // await this.enableTorusTxProvider() 83 | // break 84 | // case 'bitski': 85 | // await this.enableBitskiTxProvider() 86 | // break 87 | // case 'ledger': 88 | // await this.enableLedgerTxProvider() 89 | // break 90 | case 'metamask': 91 | default: 92 | return window.ethereum 93 | } 94 | } 95 | } 96 | 97 | const mutations = { 98 | IDENTIFY(state, ethAccount) { 99 | state.ethAccount = ethAccount 100 | }, 101 | SET_NET_ID(state, netId) { 102 | netId = parseInt(netId, 10) 103 | state.netId = netId 104 | }, 105 | INIT_PROVIDER_REQUEST(state) { 106 | state.initProvider = true 107 | }, 108 | INIT_PROVIDER_FAILED(state) { 109 | state.initProvider = false 110 | }, 111 | INIT_PROVIDER_SUCCESS(state) { 112 | state.initProvider = false 113 | }, 114 | SET_BALANCE(state, balance) { 115 | state.balance = fromWei(balance) 116 | }, 117 | SET_ADDRESS(state, { address, valid = false }) { 118 | state.address = { 119 | value: address, 120 | valid 121 | } 122 | }, 123 | SET_PROVIDER_NAME(state, providerName) { 124 | state.providerName = providerName 125 | }, 126 | SET_NETWORK_NAME(state, networkName) { 127 | state.networkName = networkName 128 | } 129 | } 130 | 131 | const actions = { 132 | setAddress({ dispatch, commit }, { address }) { 133 | const isAddressValid = address.length >= 42 && isAddress(address) 134 | commit('SET_ADDRESS', { 135 | address, 136 | valid: isAddressValid 137 | }) 138 | }, 139 | onNetworkChanged({ commit }, { netId }) { 140 | commit('SET_NET_ID', netId) 141 | }, 142 | async getBalance({ state, commit }) { 143 | try { 144 | const balance = await this.$provider.getBalance({ address: state.ethAccount }) 145 | commit('SET_BALANCE', balance) 146 | 147 | return balance 148 | } catch (err) { 149 | throw new Error(err.message) 150 | } 151 | }, 152 | async askPermission({ commit, dispatch, getters }, { providerName, networkName, version }) { 153 | commit('SET_PROVIDER_NAME', providerName) 154 | commit('SET_NETWORK_NAME', networkName) 155 | 156 | try { 157 | commit('INIT_PROVIDER_REQUEST') 158 | 159 | const provider = await getters.getEthereumProvider 160 | const address = await this.$provider.initProvider(provider, { version }) 161 | 162 | commit('IDENTIFY', address) 163 | dispatch('setAddress', { address }) 164 | 165 | // const netId = await this.$provider.checkNetworkVersion() 166 | let netId = await this.$provider.sendRequest({ 167 | method: 'eth_chainId', 168 | params: [] 169 | }) 170 | netId = Number(netId) 171 | console.log('netId', netId) 172 | dispatch('onNetworkChanged', { netId }) 173 | dispatch('gasPrice/gasWatcher', {}, { root: true }) 174 | 175 | this.$provider.initWeb3(networkConfig[`netId${netId}`].rpcUrl) 176 | 177 | await dispatch('getBalance') 178 | 179 | this.$provider.on({ 180 | method: 'chainChanged', 181 | callback: () => { 182 | dispatch('onNetworkChanged', { netId }) 183 | } 184 | }) 185 | 186 | this.$provider.on({ 187 | method: 'accountsChanged', 188 | callback: (newAccount) => { 189 | onAccountsChanged({ dispatch, commit, newAccount }) 190 | } 191 | }) 192 | 193 | dispatch('token/getTokenAddress', {}, { root: true }) 194 | dispatch('token/getTokenBalance', {}, { root: true }) 195 | 196 | commit('INIT_PROVIDER_SUCCESS') 197 | return { netId, ethAccount: address } 198 | } catch (err) { 199 | commit('INIT_PROVIDER_FAILED') 200 | throw new Error(err.message) 201 | } 202 | } 203 | } 204 | 205 | export default { 206 | namespaced: true, 207 | state, 208 | getters, 209 | mutations, 210 | actions 211 | } 212 | -------------------------------------------------------------------------------- /front/store/token.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | import { fromWei, toWei, numberToHex, hexToNumberString } from 'web3-utils' 3 | import ABI from '@/abis/ERC20.abi.json' 4 | import networkConfig from '@/networkConfig' 5 | 6 | const state = () => { 7 | return { 8 | address: null, 9 | balance: '0', 10 | txs: [] 11 | } 12 | } 13 | 14 | const getters = {} 15 | 16 | const mutations = { 17 | SET_TOKEN_ADDRESS(state, address) { 18 | state.address = address 19 | }, 20 | SET_TOKEN_BALANCE(state, balance) { 21 | state.balance = fromWei(balance) 22 | }, 23 | ADD_TX(state, txHash) { 24 | state.txs.push(txHash) 25 | } 26 | } 27 | 28 | const actions = { 29 | async getTokenBalance({ rootState, commit }) { 30 | try { 31 | const { ethAccount, netId } = rootState.metamask 32 | const { verifyingContract } = networkConfig[`netId${netId}`] 33 | 34 | const tokenInstance = new this.$provider.web3.eth.Contract(ABI, verifyingContract, { 35 | from: ethAccount 36 | }) 37 | 38 | const data = tokenInstance.methods.balanceOf(ethAccount).encodeABI() 39 | 40 | const callParams = { 41 | method: 'eth_call', 42 | params: [{ 43 | data, 44 | from: ethAccount, 45 | to: tokenInstance._address 46 | }, 'latest'] 47 | } 48 | 49 | const balance = await this.$provider.sendRequest(callParams) 50 | 51 | commit('SET_TOKEN_BALANCE', hexToNumberString(balance)) 52 | } catch (err) { 53 | throw new Error(err.message) 54 | } 55 | }, 56 | 57 | getTokenAddress({ rootState, commit }) { 58 | try { 59 | const { ethAccount, netId } = rootState.metamask 60 | const { verifyingContract } = networkConfig[`netId${netId}`] 61 | 62 | const tokenInstance = new this.$provider.web3.eth.Contract(ABI, verifyingContract, { 63 | from: ethAccount 64 | }) 65 | 66 | commit('SET_TOKEN_ADDRESS', tokenInstance._address) 67 | } catch (err) { 68 | throw new Error(err.message) 69 | } 70 | }, 71 | 72 | async mintTokens({ state, getters, rootState, rootGetters, dispatch, commit }, { to, amount, gasParams }) { 73 | try { 74 | amount = amount.toString() 75 | if (!gasParams) { 76 | gasParams = rootState.gasPrice.gasParams 77 | } 78 | 79 | const { ethAccount, netId } = rootState.metamask 80 | const { verifyingContract } = networkConfig[`netId${netId}`] 81 | 82 | const tokenInstance = new this.$provider.web3.eth.Contract(ABI, verifyingContract, { 83 | from: ethAccount 84 | }) 85 | 86 | const data = tokenInstance.methods.mint(to, toWei(amount)).encodeABI() 87 | const gas = await tokenInstance.methods.mint(to, toWei(amount)).estimateGas() 88 | 89 | const callParams = { 90 | method: 'eth_sendTransaction', 91 | params: [{ 92 | data, 93 | value: '0x0', 94 | from: ethAccount, 95 | to: tokenInstance._address, 96 | gas: numberToHex(gas + 100000), 97 | ...gasParams 98 | }] 99 | } 100 | 101 | const txHash = await this.$provider.sendRequest(callParams) 102 | commit('ADD_TX', txHash) 103 | } catch (err) { 104 | if (err.message.includes('EIP-1559')) { 105 | const gasPrice = await dispatch('gasPrice/fetchGasPrice', {}, { root: true }) 106 | 107 | await dispatch('mintTokens', { to, amount, gasParams: { gasPrice } }) 108 | } else { 109 | throw new Error(err.message) 110 | } 111 | } 112 | } 113 | } 114 | 115 | export default { 116 | namespaced: true, 117 | state, 118 | getters, 119 | mutations, 120 | actions 121 | } 122 | -------------------------------------------------------------------------------- /front/utils/errorParser.js: -------------------------------------------------------------------------------- 1 | const usersRejectErrors = ['User rejected', 'User denied'] 2 | 3 | export const getExpectedError = (message) => { 4 | const isUserDeniedErrors = usersRejectErrors.find(expectedError => 5 | message.includes(expectedError) 6 | ) 7 | 8 | if (isUserDeniedErrors) { 9 | return 'You declined an action in your wallet' 10 | } 11 | 12 | return message 13 | } 14 | 15 | export const errorParser = (message) => { 16 | try { 17 | const [, errorParsedText] = message.match(/message":"(.+)"/) 18 | 19 | if (!errorParsedText) { 20 | return getExpectedError(message) 21 | } 22 | return errorParsedText 23 | } catch (err) { 24 | // eslint-disable-next-line no-console 25 | console.warn('Error parser error: ', err.message) 26 | return getExpectedError(message) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /front/utils/index.js: -------------------------------------------------------------------------------- 1 | export * from './errorParser' 2 | -------------------------------------------------------------------------------- /migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | const Migrations = artifacts.require("Migrations"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /migrations/2_deploy.js: -------------------------------------------------------------------------------- 1 | const FaucetToken = artifacts.require("FaucetToken"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(FaucetToken) 5 | }; 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "erc20faucet", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "flatten": "truffle-flattener contracts/FaucetToken.sol > flatToken.sol", 8 | "test": "mocha --timeout 100000 --file ./test/bootstrap.js --exit" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "truffle": "^5.0.7" 14 | }, 15 | "dependencies": { 16 | "chai": "^4.2.0", 17 | "dappeteer": "^0.6.0", 18 | "html-minifier": "^4.0.0", 19 | "mocha": "^6.1.4", 20 | "openzeppelin-solidity": "^2.2.0-rc.1", 21 | "puppeteer": "^1.17.0", 22 | "truffle-flattener": "^1.3.0", 23 | "web3": "^1.0.0-beta.52" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/bootstrap.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | const { spawn, spawnSync, exec } = require('child_process') 3 | const http = require('http') 4 | const puppeteer = require('puppeteer') 5 | const dappeteer = require('dappeteer') 6 | const { before, after } = require('mocha') 7 | const Web3 = require('web3') 8 | 9 | function timeout(ms = 1000) { 10 | return new Promise(resolve => setTimeout(resolve, ms)) 11 | } 12 | 13 | const opts = { 14 | headless: false, 15 | timeout: 0, 16 | args: ['--start-maximized', '--window-size=1920,1040'] 17 | } 18 | 19 | before(async () => { 20 | exec('sh ./kill.sh') 21 | // exec('sh ./testSetup/kill.sh') 22 | const isAppStarted = await new Promise(resolve => 23 | http.get('http://localhost:3000', () => resolve(true)).on('error', () => resolve(false)) 24 | ) 25 | 26 | global.ganacheProcess = spawn( 27 | 'npx', 28 | ['ganache-cli', '--deterministic', '-p', '8545', '-i', '333', '--gasLimit', '0x4A817C800'] 29 | // { stdio: 'inherit', shell: true } 30 | ) 31 | console.log('BEFORE ', global.ganacheProcess.pid) 32 | // await timeout(5000) 33 | spawnSync('npx', ['truffle', 'migrate', '--reset', '--network', 'test'], { 34 | stdio: 'inherit' 35 | }) 36 | 37 | global.web3 = new Web3('http://localhost:8545', null, { 38 | transactionConfirmationBlocks: 1, 39 | defaultAccount: '0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1', 40 | defaultGas: 2000000, 41 | defaultGasPrice: '1000000000' 42 | }) 43 | const TokenMock = require('../build/contracts/FaucetToken.json') 44 | global.tokenContract = await new global.web3.eth.Contract(TokenMock.abi, null, { 45 | data: TokenMock.bytecode 46 | }) 47 | .deploy() 48 | .send() 49 | 50 | global.browser = await dappeteer.launch(puppeteer, opts) 51 | global.metamask = await dappeteer.getMetamask(global.browser, { 52 | seed: 'YOUR SEED' 53 | }) 54 | await global.metamask.switchNetwork('kovan') 55 | }) 56 | 57 | after(async () => { 58 | await global.browser.close() 59 | global.ganacheProcess.kill('SIGKILL') 60 | if (global.appProcess) { 61 | global.appProcess.kill('SIGKILL') 62 | } 63 | exec('sh ./test/kill.sh') 64 | await timeout(2000) 65 | }) 66 | -------------------------------------------------------------------------------- /test/first.js: -------------------------------------------------------------------------------- 1 | 2 | /* eslint-disable no-console */ 3 | require('chai').should() 4 | function timeout(ms = 1000) { 5 | return new Promise(resolve => setTimeout(resolve, ms)) 6 | } 7 | describe('test suite', () => { 8 | let firstTime = true 9 | beforeEach(async () => { 10 | page = await global.browser.newPage() 11 | await page.goto('http://localhost:3000') 12 | if (firstTime) { 13 | firstTime = false 14 | await global.metamask.confirmTransaction() // connect 15 | } 16 | await page.bringToFront() 17 | await page.reload() 18 | }) 19 | 20 | afterEach(async () => { 21 | await page.close() 22 | }) 23 | 24 | it('test', async () => { 25 | await timeout(2000) 26 | const button = await page.$('.button') 27 | await button.click() 28 | await global.metamask.confirmTransaction() 29 | await page.bringToFront() 30 | }) 31 | }) -------------------------------------------------------------------------------- /test/kill.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/bash 3 | kill $(ps aux | grep 'ganache-cli' | awk '{print $2}') 4 | #kill $(ps aux | grep 'nuxt' | awk '{print $2}') -------------------------------------------------------------------------------- /truffle-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Use this file to configure your truffle project. It's seeded with some 3 | * common settings for different networks and features like migrations, 4 | * compilation and testing. Uncomment the ones you need or modify 5 | * them to suit your project as necessary. 6 | * 7 | * More information about configuration can be found at: 8 | * 9 | * truffleframework.com/docs/advanced/configuration 10 | * 11 | * To deploy via Infura you'll need a wallet provider (like truffle-hdwallet-provider) 12 | * to sign your transactions before they're sent to a remote public node. Infura API 13 | * keys are available for free at: infura.io/register 14 | * 15 | * You'll also need a mnemonic - the twelve word phrase the wallet uses to generate 16 | * public/private key pairs. If you're publishing your code to GitHub make sure you load this 17 | * phrase from a file you've .gitignored so it doesn't accidentally become public. 18 | * 19 | */ 20 | 21 | // const HDWalletProvider = require('truffle-hdwallet-provider'); 22 | // const infuraKey = "fj4jll3k....."; 23 | // 24 | // const fs = require('fs'); 25 | // const mnemonic = fs.readFileSync(".secret").toString().trim(); 26 | 27 | module.exports = { 28 | /** 29 | * Networks define how you connect to your ethereum client and let you set the 30 | * defaults web3 uses to send transactions. If you don't specify one truffle 31 | * will spin up a development blockchain for you on port 9545 when you 32 | * run `develop` or `test`. You can ask a truffle command to use a specific 33 | * network from the command line, e.g 34 | * 35 | * $ truffle test --network 36 | */ 37 | 38 | networks: { 39 | // Useful for testing. The `development` name is special - truffle uses it by default 40 | // if it's defined here and no other network is specified at the command line. 41 | // You should run a client (like ganache-cli, geth or parity) in a separate terminal 42 | // tab if you use this network and you must also set the `host`, `port` and `network_id` 43 | // options below to some value. 44 | // 45 | development: { 46 | host: "127.0.0.1", // Localhost (default: none) 47 | port: 8545, // Standard Ethereum port (default: none) 48 | network_id: "*", // Any network (default: none) 49 | }, 50 | test: { 51 | host: "127.0.0.1", // Localhost (default: none) 52 | port: 8545, // Standard Ethereum port (default: none) 53 | network_id: "*", // Any network (default: none) 54 | }, 55 | 56 | // Another network with more advanced options... 57 | // advanced: { 58 | // port: 8777, // Custom port 59 | // network_id: 1342, // Custom network 60 | // gas: 8500000, // Gas sent with each transaction (default: ~6700000) 61 | // gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei) 62 | // from:
, // Account to send txs from (default: accounts[0]) 63 | // websockets: true // Enable EventEmitter interface for web3 (default: false) 64 | // }, 65 | 66 | // Useful for deploying to a public network. 67 | // NB: It's important to wrap the provider as a function. 68 | // ropsten: { 69 | // provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/${infuraKey}`), 70 | // network_id: 3, // Ropsten's id 71 | // gas: 5500000, // Ropsten has a lower block limit than mainnet 72 | // confirmations: 2, // # of confs to wait between deployments. (default: 0) 73 | // timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50) 74 | // skipDryRun: true // Skip dry run before migrations? (default: false for public nets ) 75 | // }, 76 | 77 | // Useful for private networks 78 | // private: { 79 | // provider: () => new HDWalletProvider(mnemonic, `https://network.io`), 80 | // network_id: 2111, // This network is yours, in the cloud. 81 | // production: true // Treats this network as if it was a public net. (default: false) 82 | // } 83 | }, 84 | 85 | // Set default mocha options here, use special reporters etc. 86 | mocha: { 87 | // timeout: 100000 88 | }, 89 | 90 | // Configure your compilers 91 | compilers: { 92 | solc: { 93 | version: "0.5.4", // Fetch exact version from solc-bin (default: truffle's version) 94 | docker: false, // Use "0.5.1" you've installed locally with docker (default: false) 95 | settings: { // See the solidity docs for advice about optimization and evmVersion 96 | optimizer: { 97 | enabled: true, 98 | runs: 200 99 | }, 100 | evmVersion: "byzantium" 101 | } 102 | } 103 | } 104 | } 105 | --------------------------------------------------------------------------------