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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import '@openzeppelin/contracts/utils/Address.sol'; | |
| import '@openzeppelin/contracts/utils/Context.sol'; | |
| import '@openzeppelin/contracts/utils/math/Math.sol'; | |
| import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; | |
| import 'hardhat/console.sol'; | |
| /** |
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
| router.get("/posts/", async (req: express.Request, res: express.Response) => { | |
| try { | |
| let { caddress: contractAddresses, waddress: walletAddresses } = req.query | |
| contractAddresses = contractAddresses ? contractAddresses.toString().split(",") : contractAddresses | |
| walletAddresses = walletAddresses ? walletAddresses.toString().split(",") : walletAddresses | |
| const trimmedContractAddresses = trimArrayInputs(walletAddresses); | |
| const validContractAddresses = getValidEthereumAddresses( | |
| trimmedContractAddresses | |
| ); | |
| if (validContractAddresses.length == 0) return res.status(400).json({ data: [], message: "Invalid address inputs" }); |
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.6.0; | |
| pragma experimental ABIEncoderV2; | |
| import "./helpers/Ownable.sol"; | |
| import "./libraries/ExchangeStruct.sol"; | |
| import "./libraries/ExchangeFunc.sol"; | |
| import "@openzeppelin/upgrades/contracts/Initializable.sol"; | |
| /** | |
| * @title GetEquity Exchange contract |
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
| /** | |
| * return full email body | |
| * @param {string} partialBody | |
| */ | |
| exports.emailBody = (partialBody) => { | |
| const body = ` | |
| <!DOCTYPE html | |
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
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 mongoose = require('mongoose'); | |
| const utils = require("./utils"); | |
| const RabbitMQ = require('./rabbitmq') | |
| const subscriber = require('./rabbitmq') | |
| require('dotenv').config(); | |
| // Socket config | |
| module.exports = { | |
| mongo() { | |
| mongoose.promise = global.promise; |
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.0; | |
| contract Casino { | |
| uint private start; | |
| uint private buyPeriod = 1000; | |
| uint private verifyPeriod = 100; | |
| uint private checkPeriod = 100; | |
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.6.10; | |
| // SPDX-License-Identifier: MIT | |
| import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
| contract MyToken is ERC20 { | |
| constructor(string memory name, string memory symbol) | |
| public | |
| ERC20(name, symbol) | |
| { | |
| // Mint 100 tokens to msg.sender |
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
| class BaseProvider { | |
| constructor (_name) { | |
| if ( | |
| _name == null || | |
| _name === undefined || | |
| typeof _name !== 'string' | |
| ) { | |
| throw new Error('Class needs to be instantiated with an provider name') | |
| } | |
| this.name = _name |
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
| type User struct { | |
| mogo.DocumentModel `bson:",inline" coll:"users"` | |
| Username string `json:"username" binding:"required"` | |
| Email string `idx:"{email},unique" json:"email" binding:"required"` | |
| Password string `json:"password" binding:"required"` | |
| FirstName string `json:"firstname"` | |
| LastName string `json:"lastname"` | |
| // CreatedAt *time.Time | |
| // UpdatedAt *time.Time | |
| Verified *time.Time `json:"_verified"` |
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
| type User struct { | |
| mogo.DocumentModel `bson:",inline" coll:"users"` | |
| Username string `json:"username" binding:"required"` | |
| Email string `idx:"{email},unique" json:"email" binding:"required"` | |
| Password string `json:"password" binding:"required"` | |
| FirstName string `json:"firstname"` | |
| LastName string `json:"lastname"` | |
| // CreatedAt *time.Time | |
| // UpdatedAt *time.Time | |
| Verified *time.Time `json:"_verified"` |
NewerOlder