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

Add support for BASE blockchain #3216

Merged
merged 9 commits into from
Jun 21, 2024
29 changes: 29 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,16 @@
"rpcEndpoints": ["https://rpc.chiadochain.net"],
"operatorFee": 0
}
},
"base:84532": {
"enabled": false,
"package": "./blockchain/implementation/base/base-service.js",

"config": {
"hubContractAddress": "0x144eDa5cbf8926327cb2cceef168A121F0E4A299",
"rpcEndpoints": ["https://sepolia.base.org"],
"operatorFee": 0
}
}
}
},
Expand Down Expand Up @@ -617,6 +627,16 @@
"rpcEndpoints": ["https://rpc.chiadochain.net"],
"operatorFee": 0
}
},
"base:84532": {
"enabled": false,
"package": "./blockchain/implementation/base/base-service.js",

"config": {
"hubContractAddress": "0x6C861Cb69300C34DfeF674F7C00E734e840C29C0",
"rpcEndpoints": ["https://sepolia.base.org"],
"operatorFee": 0
}
}
}
},
Expand Down Expand Up @@ -791,6 +811,15 @@
"gasPriceOracleLink": "https://api.gnosisscan.io/api?module=proxy&action=eth_gasPrice",
"operatorFee": 0
}
},
"base:8453": {
"enabled": false,
"package": "./blockchain/implementation/base/base-service.js",

"config": {
"hubContractAddress": "",
"operatorFee": 0
}
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "origintrail_node",
"version": "6.4.0",
"version": "6.4.1",
"description": "OTNode V6",
"main": "index.js",
"type": "module",
Expand Down
1 change: 1 addition & 0 deletions src/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ export const BLOCK_TIME_MILLIS = {
HARDHAT: 5_000,
GNOSIS: 5_000,
DEFAULT: 12_000,
BASE: 2_000,
};

export const TRANSACTION_CONFIRMATIONS = 1;
Expand Down
25 changes: 25 additions & 0 deletions src/modules/blockchain/implementation/base/base-service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Web3Service from '../web3-service.js';
import { BLOCK_TIME_MILLIS } from '../../../../constants/constants.js';

class BaseService extends Web3Service {
constructor(ctx) {
super(ctx);

this.baseTokenTicker = 'ETH';
this.tracTicker = 'TRAC';
}

getBlockTimeMillis() {
return BLOCK_TIME_MILLIS.BASE;
}

async getGasPrice() {
return this.provider.getGasPrice();
}

async getAgreementScoreFunctionId() {
return 2;
}
}

export default BaseService;
Loading