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

Adding NEAR EVM support #1

Closed
wants to merge 9 commits 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ coverage.json
coverage/
yarn-error.log
crytic-export
mcore_*
mcore_*
neardev/
1 change: 1 addition & 0 deletions 1.test.near.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"account_id":"1.test.near","public_key":"ed25519:AdKaReGjRqPcUTfKah4k1Fv1af6seLj4FtpkxLsFfgQL","secret_key":"ed25519:3qR2uxAN7SUfi9HziHGejXRcprNK2YkYKnpKjtzm7rvgxkXW5MDMbKZMAEsxcnFJgtb2W7QgAChc1cvr2Da8b6eY"}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"compile": "truffle compile",
"testrpc": "ganache-cli --deterministic --gasLimit 10000000",
"test": "truffle test",
"test": "truffle test --network near_local",
"test:verbose": "VERBOSE=true truffle test",
"coverage": "yarn solidity-coverage",
"lint": "eslint .",
Expand All @@ -31,12 +31,13 @@
"eslint-plugin-react": "^7.17.0",
"ganache-core": "^2.6.1",
"mocha": "^6.2.0",
"near-web3-provider": "https://github.com/near/near-web3-provider#3d16010cb362981849530fb2949280b4a7918353",
"solhint": "^2.3.0",
"solidity-coverage": "^0.6.7",
"standard": "^14.0.2",
"truffle": "^5.0.41",
"truffle-assertions": "^0.9.1",
"web3": "^1.2.0"
"web3": "^1.2.11"
},
"dependencies": {
"decimal.js": "^10.2.0",
Expand Down
1 change: 0 additions & 1 deletion test/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ contract('BPool', async (accounts) => {
});
});


describe('Finalizing pool', () => {
it('Fails when other users interact before finalizing', async () => {
await truffleAssert.reverts(
Expand Down
42 changes: 38 additions & 4 deletions truffle-config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,45 @@
const path = require('path');

const { NearProvider } = require('near-web3-provider');

function NearLocalProvider() {
return new NearProvider({
nodeUrl: 'http://127.0.0.1:3030',
networkId: 'local',
masterAccountId: 'test.near',
numTestAccounts: 5,
keyPath: path.join(process.env.HOME, '.near/local/validator_key.json'),
});
}

function NearTestNetProvider() {
return new NearProvider({
nodeUrl: 'http://34.82.212.1:3030',
networkId: 'default',
masterAccountId: '1.test.near',
evmAccountId: 'evm',
keyPath: path.join(__dirname, '1.test.near.json'),
});
}

module.exports = {
networks: {
near: {
network_id: "*",
skipDryRun: true,
provider: () => NearTestNetProvider(),
},
development: {
host: 'localhost', // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: '*', // Any network (default: none)
gas: 10000000,
network_id: "*",
skipDryRun: true,
provider: () => NearLocalProvider(),
},
// development: {
// host: 'localhost', // Localhost (default: none)
// port: 8545, // Standard Ethereum port (default: none)
// network_id: '*', // Any network (default: none)
// gas: 10000000,
// },
coverage: {
host: 'localhost',
network_id: '*',
Expand Down
Loading