-
Notifications
You must be signed in to change notification settings - Fork 7
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
Jerry
committed
May 15, 2022
1 parent
24cacbd
commit 2e516dd
Showing
18 changed files
with
246 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: Unlicensed | ||
pragma solidity 0.8.13; | ||
|
||
import '../sft-factory/P12AssetFactoryUpgradable.sol'; | ||
|
||
contract P12AssetFactoryUpgradableAlter is P12AssetFactoryUpgradable { | ||
function setP12factory(address newAddr) public onlyOwner { | ||
p12factory = newAddr; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.13; | ||
|
||
import '../staking/P12MineUpgradeable.sol'; | ||
|
||
contract P12MineUpgradeableAlter is P12MineUpgradeable { | ||
function setP12factory(address newAddr) public onlyOwner { | ||
p12Factory = newAddr; | ||
} | ||
} |
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,9 @@ | ||
module.exports = { | ||
solidity: '0.8.13', | ||
settings: { | ||
optimizer: { | ||
enabled: true, | ||
runs: 200, | ||
}, | ||
}, | ||
}; |
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,29 @@ | ||
import env, { ethers } from 'hardhat'; | ||
import * as compiledUniswapFactory from '@uniswap/v2-core/build/UniswapV2Factory.json'; | ||
import * as compiledUniswapRouter from '@uniswap/v2-periphery/build/UniswapV2Router02.json'; | ||
|
||
async function main() { | ||
if (env.network.name === 'p12TestNet') { | ||
const admin = (await ethers.getSigners())[0]; | ||
const weth = '0x0EE3F0848cA07E6342390C34FcC7Ea9D0217a47d'; | ||
// deploy uniswap | ||
const UNISWAPV2ROUTER = new ethers.ContractFactory(compiledUniswapRouter.abi, compiledUniswapRouter.bytecode, admin); | ||
const UNISWAPV2FACTORY = new ethers.ContractFactory( | ||
compiledUniswapFactory.interface, | ||
compiledUniswapFactory.bytecode, | ||
admin, | ||
); | ||
const uniswapV2Factory = await UNISWAPV2FACTORY.connect(admin).deploy(admin.address); | ||
|
||
const uniswapV2Router02 = await UNISWAPV2ROUTER.connect(admin).deploy(uniswapV2Factory.address, weth); | ||
|
||
console.log('uniswapV2Factory: ', uniswapV2Factory.address, 'uniswapV2Router: ', uniswapV2Router02.address); | ||
} else if (env.network.name === 'rinkeby') { | ||
console.log('nothing happened'); | ||
} | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
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,23 @@ | ||
import env, { ethers, upgrades } from 'hardhat'; | ||
|
||
async function main() { | ||
if (env.network.name === 'p12TestNet') { | ||
const P12V0FactoryUpgradeableF = await ethers.getContractFactory('P12V0FactoryUpgradeable2'); | ||
|
||
const proxyAddr = '0x3288095c0033E33DcD25bf2cf439B848b45DFB70'; | ||
|
||
// const p12Token = '0xeAc1F044C4b9B7069eF9F3eC05AC60Df76Fe6Cd0'; | ||
// const uniswapV2Factory = '0x8C2543578eFEd64343C63e9075ed70F1d255D1c6'; | ||
// const uniswapV2Router = '0x71A3B75A9A774EB793A44a36AF760ee2868912ac'; | ||
await upgrades.upgradeProxy(proxyAddr, P12V0FactoryUpgradeableF); | ||
|
||
console.log('proxy contract', proxyAddr); | ||
} else if (env.network.name === 'rinkeby') { | ||
console.log('nothing happen'); | ||
} | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
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,28 @@ | ||
// We require the Hardhat Runtime Environment explicitly here. This is optional | ||
// but useful for running the script in a standalone fashion through `node <script>`. | ||
// | ||
// When running the script with `npx hardhat run <script>` you'll find the Hardhat | ||
// Runtime Environment's members available in the global scope. | ||
import env, { ethers, upgrades } from 'hardhat'; | ||
|
||
async function main() { | ||
if (env.network.name === 'p12TestNet') { | ||
const P12AssetFactoryUpgradableF = await ethers.getContractFactory('P12AssetFactoryUpgradable'); | ||
|
||
const proxyAddr = '0x173e4D790A43E3016AAeD9Bbd0987CD760f0dB9F'; | ||
|
||
// const p12Token = '0xeAc1F044C4b9B7069eF9F3eC05AC60Df76Fe6Cd0'; | ||
// const uniswapV2Factory = '0x8C2543578eFEd64343C63e9075ed70F1d255D1c6'; | ||
// const uniswapV2Router = '0x71A3B75A9A774EB793A44a36AF760ee2868912ac'; | ||
await upgrades.upgradeProxy(proxyAddr, P12AssetFactoryUpgradableF); | ||
|
||
console.log('proxy contract', proxyAddr); | ||
} | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
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.