Skip to content
Merged
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
4 changes: 1 addition & 3 deletions evm/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
INFURA_API_KEY=
EVM_PRIVATE_KEY=
ETHERSCAN_API_KEY=
BASESCAN_API_KEY=
ARBISCAN_API_KEY=
ETHERSCAN_API_KEY=
273 changes: 273 additions & 0 deletions evm/.openzeppelin/bsc-testnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
{
"manifestVersion": "3.2",
"proxies": [
{
"address": "0xEC81aFc3485a425347Ac03316675e58a680b283A",
"txHash": "0x671b413081ad5e75c13bf2cdd63d73ce77023d8fed87ce87acce6b1d07aa79e0",
"kind": "uups"
}
],
"impls": {
"2c4d3ef629440dbfa9338f12883a7fe9c537bc6b40055ff4472f0598460bbc23": {
"address": "0xB9dE9F72e81d1609E940Fb2217f7286602064881",
"txHash": "0x07ca6a506bcea4cca90ac15806c2ed4ff3172e5f08524aff9bfc80fe879c0503",
"layout": {
"solcVersion": "0.8.24",
"storage": [
{
"label": "ethToNearToken",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_address,t_string_storage)",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:24"
},
{
"label": "nearToEthToken",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_string_memory_ptr,t_address)",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:25"
},
{
"label": "isBridgeToken",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_address,t_bool)",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:26"
},
{
"label": "tokenImplementationAddress",
"offset": 0,
"slot": "3",
"type": "t_address",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:28"
},
{
"label": "nearBridgeDerivedAddress",
"offset": 0,
"slot": "4",
"type": "t_address",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:29"
},
{
"label": "omniBridgeChainId",
"offset": 20,
"slot": "4",
"type": "t_uint8",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:30"
},
{
"label": "completedTransfers",
"offset": 0,
"slot": "5",
"type": "t_mapping(t_uint64,t_bool)",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:32"
},
{
"label": "currentOriginNonce",
"offset": 0,
"slot": "6",
"type": "t_uint64",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:33"
},
{
"label": "customMinters",
"offset": 0,
"slot": "7",
"type": "t_mapping(t_address,t_address)",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:35"
},
{
"label": "__gap",
"offset": 0,
"slot": "8",
"type": "t_array(t_uint256)50_storage",
"contract": "OmniBridge",
"src": "src/omni-bridge/contracts/OmniBridge.sol:345"
},
{
"label": "_wormhole",
"offset": 0,
"slot": "58",
"type": "t_contract(IWormhole)6037",
"contract": "OmniBridgeWormhole",
"src": "src/omni-bridge/contracts/OmniBridgeWormhole.sol:27"
},
{
"label": "_consistencyLevel",
"offset": 20,
"slot": "58",
"type": "t_uint8",
"contract": "OmniBridgeWormhole",
"src": "src/omni-bridge/contracts/OmniBridgeWormhole.sol:29"
},
{
"label": "wormholeNonce",
"offset": 21,
"slot": "58",
"type": "t_uint32",
"contract": "OmniBridgeWormhole",
"src": "src/omni-bridge/contracts/OmniBridgeWormhole.sol:30"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_bytes32": {
"label": "bytes32",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_bytes32,t_struct(RoleData)24_storage)": {
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)",
"numberOfBytes": "32"
},
"t_struct(AccessControlStorage)34_storage": {
"label": "struct AccessControlUpgradeable.AccessControlStorage",
"members": [
{
"label": "_roles",
"type": "t_mapping(t_bytes32,t_struct(RoleData)24_storage)",
"offset": 0,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_struct(InitializableStorage)266_storage": {
"label": "struct Initializable.InitializableStorage",
"members": [
{
"label": "_initialized",
"type": "t_uint64",
"offset": 0,
"slot": "0"
},
{
"label": "_initializing",
"type": "t_bool",
"offset": 8,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_struct(RoleData)24_storage": {
"label": "struct AccessControlUpgradeable.RoleData",
"members": [
{
"label": "hasRole",
"type": "t_mapping(t_address,t_bool)",
"offset": 0,
"slot": "0"
},
{
"label": "adminRole",
"type": "t_bytes32",
"offset": 0,
"slot": "1"
}
],
"numberOfBytes": "64"
},
"t_uint64": {
"label": "uint64",
"numberOfBytes": "8"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_contract(IWormhole)6037": {
"label": "contract IWormhole",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_address)": {
"label": "mapping(address => address)",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_string_storage)": {
"label": "mapping(address => string)",
"numberOfBytes": "32"
},
"t_mapping(t_string_memory_ptr,t_address)": {
"label": "mapping(string => address)",
"numberOfBytes": "32"
},
"t_mapping(t_uint64,t_bool)": {
"label": "mapping(uint64 => bool)",
"numberOfBytes": "32"
},
"t_string_memory_ptr": {
"label": "string",
"numberOfBytes": "32"
},
"t_string_storage": {
"label": "string",
"numberOfBytes": "32"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint32": {
"label": "uint32",
"numberOfBytes": "4"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
}
},
"namespaces": {
"erc7201:openzeppelin.storage.AccessControl": [
{
"contract": "AccessControlUpgradeable",
"label": "_roles",
"type": "t_mapping(t_bytes32,t_struct(RoleData)24_storage)",
"src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61",
"offset": 0,
"slot": "0"
}
],
"erc7201:openzeppelin.storage.Initializable": [
{
"contract": "Initializable",
"label": "_initialized",
"type": "t_uint64",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69",
"offset": 0,
"slot": "0"
},
{
"contract": "Initializable",
"label": "_initializing",
"type": "t_bool",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73",
"offset": 8,
"slot": "0"
}
]
}
}
}
}
}
25 changes: 15 additions & 10 deletions evm/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ dotenv.config()
const INFURA_API_KEY = process.env.INFURA_API_KEY
const EVM_PRIVATE_KEY = process.env.EVM_PRIVATE_KEY || "11".repeat(32)
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || ""
const ARBISCAN_API_KEY = process.env.ARBISCAN_API_KEY || ""
const BASESCAN_API_KEY = process.env.BASESCAN_API_KEY || ""

task("set-metadata-ft", "Set metadata for NEP-141 tokens on the Ethereum side")
.addParam("nearTokenAccount", "Near account id of the token")
Expand Down Expand Up @@ -289,6 +287,13 @@ const config: HardhatUserConfig = {
url: `https://base-mainnet.infura.io/v3/${INFURA_API_KEY}`,
accounts: [`${EVM_PRIVATE_KEY}`],
},
bnbMainnet: {
wormholeAddress: "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B",
omniChainId: 5,
chainId: 56,
url: `https://bsc-mainnet.infura.io/v3/${INFURA_API_KEY}`,
accounts: [`${EVM_PRIVATE_KEY}`],
},
sepolia: {
omniChainId: 0,
chainId: 11155111,
Expand All @@ -309,16 +314,16 @@ const config: HardhatUserConfig = {
url: `https://base-sepolia.infura.io/v3/${INFURA_API_KEY}`,
accounts: [`${EVM_PRIVATE_KEY}`],
},
bnbTestnet: {
wormholeAddress: "0x68605AD7b15c732a30b1BbC62BE8F2A509D74b4D",
omniChainId: 5,
chainId: 97,
url: `https://bsc-testnet.infura.io/v3/${INFURA_API_KEY}`,
accounts: [`${EVM_PRIVATE_KEY}`],
},
},
etherscan: {
apiKey: {
mainnet: ETHERSCAN_API_KEY,
arbitrumOne: ARBISCAN_API_KEY,
base: BASESCAN_API_KEY,
sepolia: ETHERSCAN_API_KEY,
arbitrumSepolia: ARBISCAN_API_KEY,
baseSepolia: BASESCAN_API_KEY,
},
apiKey: ETHERSCAN_API_KEY,
},
}

Expand Down
7 changes: 4 additions & 3 deletions evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
"@nomicfoundation/hardhat-verify": "^2.0.12",
"@openzeppelin/hardhat-upgrades": "^3.5.0",
"@nomicfoundation/hardhat-verify": "^2.1.1",
"@openzeppelin/hardhat-upgrades": "^3.9.1",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "4",
Expand Down Expand Up @@ -43,5 +43,6 @@
"lint:js:fix": "biome check --write",
"lint": "prettier --list-different --plugin=prettier-plugin-solidity '**/*.sol'",
"lint:fix": "prettier --write --plugin=prettier-plugin-solidity '**/*.sol'"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
1 change: 1 addition & 0 deletions evm/src/eNear/contracts/ENearProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ contract ENearProxy is UUPSUpgradeable, AccessControlUpgradeable, ICustomMinter,
function initialize(address _eNear, address _prover, bytes memory _nearConnector, uint256 _currentReceiptId, address _adminAddress) public initializer {
__UUPSUpgradeable_init();
__AccessControl_init();
__Pausable_init();
eNear = IENear(_eNear);
nearConnector = _nearConnector;
currentReceiptId = _currentReceiptId;
Expand Down
4 changes: 2 additions & 2 deletions evm/src/omni-bridge/contracts/OmniBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ contract OmniBridge is
_grantRole(PAUSABLE_ADMIN_ROLE, _msgSender());
}

function addCustomToken(string calldata nearTokenId, address tokenAddress, address customMinter, uint8 originDecimals) external onlyRole(DEFAULT_ADMIN_ROLE) {
function addCustomToken(string calldata nearTokenId, address tokenAddress, address customMinter, uint8 originDecimals) payable external onlyRole(DEFAULT_ADMIN_ROLE) {
isBridgeToken[tokenAddress] = true;
ethToNearToken[tokenAddress] = nearTokenId;
nearToEthToken[nearTokenId] = tokenAddress;
Expand Down Expand Up @@ -171,7 +171,7 @@ contract OmniBridge is

function logMetadata(
address tokenAddress
) external {
) payable external {
string memory name = IERC20Metadata(tokenAddress).name();
string memory symbol = IERC20Metadata(tokenAddress).symbol();
uint8 decimals = IERC20Metadata(tokenAddress).decimals();
Expand Down
Loading
Loading