-
Notifications
You must be signed in to change notification settings - Fork 3
/
truffle-config.js
59 lines (51 loc) · 1.73 KB
/
truffle-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const ContractKit = require('@celo/contractkit')
const Web3 = require('web3')
const path = require('path')
// Connect to the desired network
const web3 = new Web3('https://alfajores-forno.celo-testnet.org')
const kit = ContractKit.newKitFromWeb3(web3)
// const kit = Kit.newKit('https://forno.celo.org') // mainnet endpoint
const getAccount = require('./utils/getAccount').getAccount
async function awaitWrapper(){
let account = await getAccount()
console.log(`Account address: ${account.address}`)
kit.addAccount(account.privateKey)
}
awaitWrapper()
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
// The following line will put the compiled contracts and associated info at ./client/contracts
contracts_build_directory: path.join(__dirname, "client/contracts"),
networks: {
// Use the development network if you are using @celo/ganache-cli
// https://www.npmjs.com/package/@celo/ganache-cli
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
},
alfajores: {
provider: kit.web3.currentProvider,
network_id: 44787
},
mainnet: {
provider: kit.web3.currentProvider,
network_id: 42220
}
},
// Configure your compilers
compilers: {
solc: {
version: "0.8.0", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
// settings: { // See the solidity docs for advice about optimization and evmVersion
// optimizer: {
// enabled: false,
// runs: 200
// },
// evmVersion: "byzantium"
// }
}
},
};