Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic package.json and truffle-config #22

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Aave",
"author": "Aave",
"version": "0.0.1",
"license": "Apache-2.0",
"description": "",
"dependencies": {
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"bignumber.js": "^9.0.0",
"near-web3-provider": "near/near-web3-provider#precompile-package-json",
"openzeppelin-solidity": "^2.1.0",
"truffle": "^5.1.43",
"typescript": "^4.0.2"
},
"devDependencies": {
"babel-register": "^6.26.0"
}
}
70 changes: 70 additions & 0 deletions truffle-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* Audius Smart Contracts truffle configuration
* @authors Hareesh Nagaraj, Sid Sethi, Roneil Rumburg
* @version 0.0.1
*/

const { NearProvider, nearlib, utils } = require('near-web3-provider');
// Because we're using a function-call access key, this is the same as the NEAR_LOCAL_EVM
const NEAR_LOCAL_ACCOUNT_ID = 'audius.demo.testnet';
const NEAR_LOCAL_NETWORK_ID = 'default';
const NEAR_LOCAL_URL = 'https://rpc.testnet.near.org';
const NEAR_EXPLORER_URL = 'https://explorer.testnet.near.org';
const NEAR_LOCAL_EVM = 'evm.demo.testnet';

function NearLocalProvider() {
return new NearProvider({
nodeUrl: 'http://127.0.0.1:3030',
networkId: 'local',
masterAccountId: 'test.near',
evmAccountId: 'evm',
});
}

function NearTestNetProvider() {
return new NearProvider({
nodeUrl: 'https://rpc.testnet.near.org',
networkId: 'default',
masterAccountId: 'illia',
evmAccountId: 'evm.illia',
});
}

// TODO: do this only when in development.
{
const provider = NearLocalProvider();
utils.createTestAccounts(provider, 5);
}

// Import babel for ES6 support
require('babel-register')({
presets: [
['env', {
'targets': {
'node': '8.0'
}
}]
]
})

require('babel-polyfill')

module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
networks: {
near: {
network_id: "*",
skipDryRun: true,
provider: () => NearTestNetProvider(),
},
development: {
network_id: "*",
skipDryRun: true,
provider: () => NearLocalProvider(),
},
},
mocha: {
enableTimeouts: false
}
}