mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Deployed InstaMappingController contract
This commit is contained in:
parent
dedd38239a
commit
cf8cc26090
|
@ -1,6 +1,5 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
pragma solidity ^0.7.0;
|
||||||
pragma solidity >=0.6.0 <0.8.0;
|
|
||||||
|
|
||||||
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
|
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
|
||||||
import "@openzeppelin/contracts/utils/Address.sol";
|
import "@openzeppelin/contracts/utils/Address.sol";
|
||||||
|
@ -10,6 +9,10 @@ interface IndexInterface {
|
||||||
function master() external view returns (address);
|
function master() external view returns (address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ConnectorsInterface {
|
||||||
|
function chief(address) external view returns (bool);
|
||||||
|
}
|
||||||
|
|
||||||
contract InstaMappingController is Context {
|
contract InstaMappingController is Context {
|
||||||
using EnumerableSet for EnumerableSet.AddressSet;
|
using EnumerableSet for EnumerableSet.AddressSet;
|
||||||
using Address for address;
|
using Address for address;
|
||||||
|
@ -18,6 +21,9 @@ contract InstaMappingController is Context {
|
||||||
|
|
||||||
IndexInterface public constant instaIndex =
|
IndexInterface public constant instaIndex =
|
||||||
IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723);
|
IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723);
|
||||||
|
ConnectorsInterface public constant connectors =
|
||||||
|
ConnectorsInterface(0x97b0B3A8bDeFE8cB9563a3c610019Ad10DB8aD11); // InstaConnectorsV2
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Emitted when `account` is granted `role`.
|
* @dev Emitted when `account` is granted `role`.
|
||||||
|
@ -39,8 +45,8 @@ contract InstaMappingController is Context {
|
||||||
|
|
||||||
modifier onlyMaster {
|
modifier onlyMaster {
|
||||||
require(
|
require(
|
||||||
instaIndex.master() == _msgSender(),
|
instaIndex.master() == _msgSender() || connectors.chief(_msgSender()),
|
||||||
"MappingController: sender must be master"
|
"MappingController: sender must be master or chief"
|
||||||
);
|
);
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
{
|
||||||
|
"connectors":
|
||||||
{
|
{
|
||||||
"1" : {
|
"1" : {
|
||||||
"AUTHORITY-A": "0x351Bb32e90C35647Df7a584f3c1a3A0c38F31c68",
|
"AUTHORITY-A": "0x351Bb32e90C35647Df7a584f3c1a3A0c38F31c68",
|
||||||
|
@ -32,4 +34,8 @@
|
||||||
"AAVE-CLAIM-A": "0xC7Cb1dE2721BFC0E0DA1b9D526bCdC54eF1C0eFC",
|
"AAVE-CLAIM-A": "0xC7Cb1dE2721BFC0E0DA1b9D526bCdC54eF1C0eFC",
|
||||||
"PARASWAP-A": "0xFb3a1D56eD56F046721B9aCa749895100754578b"
|
"PARASWAP-A": "0xFb3a1D56eD56F046721B9aCa749895100754578b"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"mappings": {
|
||||||
|
"InstaMappingController": "0xDdd075D5e1024901E4038461e1e4BbC3A48a08d4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
36
scripts/deployInstaMappingController.js
Normal file
36
scripts/deployInstaMappingController.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
const hre = require('hardhat')
|
||||||
|
const { ethers } = hre
|
||||||
|
|
||||||
|
async function main () {
|
||||||
|
if (hre.network.name === 'mainnet') {
|
||||||
|
console.log(
|
||||||
|
'\n\n Deploying Contracts to mainnet. Hit ctrl + c to abort'
|
||||||
|
)
|
||||||
|
} else if (hre.network.name === 'hardhat') {
|
||||||
|
console.log(
|
||||||
|
'\n\n Deploying Contracts to hardhat.'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const InstaMappingController = await ethers.getContractFactory('InstaMappingController')
|
||||||
|
const instaMappingController = await InstaMappingController.deploy()
|
||||||
|
await instaMappingController.deployed()
|
||||||
|
|
||||||
|
console.log('InstaMappingController deployed: ', instaMappingController.address)
|
||||||
|
|
||||||
|
if (hre.network.name === 'mainnet') {
|
||||||
|
await hre.run('verify:verify', {
|
||||||
|
address: instaMappingController.address,
|
||||||
|
constructorArguments: []
|
||||||
|
})
|
||||||
|
} else if (hre.network.name === 'hardhat') {
|
||||||
|
console.log("Contracts deployed.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
.then(() => process.exit(0))
|
||||||
|
.catch(error => {
|
||||||
|
console.error(error)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
38
scripts/deployMappingContract.js
Normal file
38
scripts/deployMappingContract.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
const hre = require('hardhat')
|
||||||
|
const { ethers } = hre
|
||||||
|
|
||||||
|
async function main () {
|
||||||
|
if (hre.network.name === 'mainnet') {
|
||||||
|
console.log(
|
||||||
|
'\n\n Deploying Contracts to mainnet. Hit ctrl + c to abort'
|
||||||
|
)
|
||||||
|
} else if (hre.network.name === 'hardhat') {
|
||||||
|
console.log(
|
||||||
|
'\n\n Deploying Contracts to hardhat.'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const mappingContract = "CONTRACT_NAME"
|
||||||
|
|
||||||
|
const InstaProtocolMapping = await ethers.getContractFactory(mappingContract)
|
||||||
|
const instaProtocolMapping = await InstaProtocolMapping.deploy()
|
||||||
|
await instaProtocolMapping.deployed()
|
||||||
|
|
||||||
|
console.log(`${mappingContract} deployed: `, instaProtocolMapping.address)
|
||||||
|
|
||||||
|
if (hre.network.name === 'mainnet') {
|
||||||
|
await hre.run('verify:verify', {
|
||||||
|
address: instaProtocolMapping.address,
|
||||||
|
constructorArguments: []
|
||||||
|
})
|
||||||
|
} else if (hre.network.name === 'hardhat') {
|
||||||
|
console.log("Contracts deployed.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
.then(() => process.exit(0))
|
||||||
|
.catch(error => {
|
||||||
|
console.error(error)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user