-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
144 changed files
with
22,978 additions
and
2,856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { toUnit } from '@utils/bn'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import IERC20 from '../../artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.json'; | ||
|
||
const deployFunction: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { deployer, kp3rV1, wkLP } = await hre.getNamedAccounts(); | ||
const keep3rV2 = await hre.deployments.get('Keep3rSidechainForTestnet'); | ||
await hre.deployments.save('wkLP', { | ||
address: wkLP, | ||
abi: IERC20.abi, | ||
}); | ||
|
||
const jobForTest = await hre.deployments.deploy('BasicJob', { | ||
from: deployer, | ||
contract: 'solidity/for-test/JobRatedForTest.sol:JobRatedForTest', | ||
args: [keep3rV2.address], | ||
log: true, | ||
}); | ||
|
||
// register job | ||
if (jobForTest.newlyDeployed) { | ||
await hre.deployments.execute('Keep3rSidechainForTestnet', { from: deployer, log: true }, 'addJob', jobForTest.address); | ||
} | ||
|
||
const LIQUIDITY = await hre.deployments.read('Keep3rSidechainForTestnet', 'liquidityAmount', jobForTest.address, wkLP); | ||
if (LIQUIDITY == 0) { | ||
// deployer needs to have kLP balance | ||
const keep3rSidechain = await hre.deployments.get('Keep3rSidechainForTestnet'); | ||
await hre.deployments.execute('wkLP', { from: deployer, log: true }, 'approve', keep3rSidechain.address, toUnit(10)); | ||
await hre.deployments.execute( | ||
'Keep3rSidechainForTestnet', | ||
{ from: deployer, log: true }, | ||
'addLiquidityToJob', | ||
jobForTest.address, | ||
wkLP, | ||
toUnit(1) | ||
); | ||
} | ||
|
||
const IS_KEEPER = await hre.deployments.read('Keep3rSidechainForTestnet', 'isKeeper', deployer); | ||
if (!IS_KEEPER) { | ||
// register deployer as keeper | ||
await hre.deployments.execute('Keep3rSidechainForTestnet', { from: deployer, log: true }, 'bond', kp3rV1, 0); | ||
await hre.deployments.execute('Keep3rSidechainForTestnet', { from: deployer, log: true, gasLimit: 1e6 }, 'activate', kp3rV1); | ||
} | ||
|
||
await hre.deployments.execute('BasicJob', { from: deployer, log: true, gasLimit: 1e6 }, 'work'); | ||
}; | ||
|
||
deployFunction.dependencies = ['approve-testnet-liquidity']; | ||
deployFunction.tags = ['job-rated-for-test']; | ||
|
||
export default deployFunction; |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { verifyContract } from 'utils/deploy'; | ||
|
||
const deployFunction: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const keep3rEscrow = await hre.deployments.get('Keep3rEscrow'); | ||
await verifyContract(hre, keep3rEscrow); | ||
|
||
const keep3rHelper = await hre.deployments.get('Keep3rHelperSidechain'); | ||
await verifyContract(hre, keep3rHelper); | ||
|
||
const keep3rV2 = await hre.deployments.get('Keep3rSidechain'); | ||
await verifyContract(hre, keep3rV2); | ||
}; | ||
|
||
deployFunction.tags = ['verify-sidechain']; | ||
|
||
export default deployFunction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.