-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: better script structure * fix: add new ABI * fix: add default MgvArbitrage to ativate script * fix: UNLICENSED to Unlicense Co-authored-by: Espen Højsgaard <[email protected]> * fix: correct license on scripts * fix: all UNLICENSED to Unlicense --------- Co-authored-by: Espen Højsgaard <[email protected]>
- Loading branch information
1 parent
0581027
commit 5f5da0c
Showing
14 changed files
with
185 additions
and
34 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
2 changes: 1 addition & 1 deletion
2
packages/mangrove-arbitrage/script/MgvArbitrageTestDeployer.s.sol
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
23 changes: 23 additions & 0 deletions
23
packages/mangrove-arbitrage/script/deployers/MumbaiMgvArbitrageDeployer.s.sol
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 @@ | ||
// SPDX-License-Identifier: Unlicense | ||
pragma solidity ^0.8.13; | ||
|
||
import {Deployer} from "mgv_script/lib/Deployer.sol"; | ||
import {MgvArbitrageDeployer} from "script/deployers/MgvArbitrageDeployer.s.sol"; | ||
|
||
contract MumbaiMgvArbitrageDeployer is Deployer { | ||
MgvArbitrageDeployer public arbDeployer; | ||
|
||
function run() public { | ||
runWithChainSpecificParams(); | ||
outputDeployment(); | ||
} | ||
|
||
function runWithChainSpecificParams() public { | ||
arbDeployer = new MgvArbitrageDeployer(); | ||
arbDeployer.innerRun({ | ||
admin: broadcaster(), | ||
arbitrager: envAddressOrName("ARBITRAGER", "Arbitrager"), | ||
mgv: envAddressOrName("MGV", "Mangrove") | ||
}); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/mangrove-arbitrage/script/deployers/PolygonMgvArbitrageDeployer.s.sol
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 @@ | ||
// SPDX-License-Identifier: Unlicense | ||
pragma solidity ^0.8.13; | ||
|
||
import {Deployer} from "mgv_script/lib/Deployer.sol"; | ||
import {MgvArbitrageDeployer} from "script/deployers/MgvArbitrageDeployer.s.sol"; | ||
|
||
contract PolygonMgvArbitrageDeployer is Deployer { | ||
MgvArbitrageDeployer public arbDeployer; | ||
|
||
function run() public { | ||
runWithChainSpecificParams(); | ||
outputDeployment(); | ||
} | ||
|
||
function runWithChainSpecificParams() public { | ||
arbDeployer = new MgvArbitrageDeployer(); | ||
arbDeployer.innerRun({ | ||
admin: broadcaster(), | ||
arbitrager: envAddressOrName("ARBITRAGER", "Arbitrager"), | ||
mgv: envAddressOrName("MGV", "Mangrove") | ||
}); | ||
} | ||
} |
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
4 changes: 2 additions & 2 deletions
4
packages/mangrove-arbitrage/test/MgvArbitrageActivateTokensTest.t.sol
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
25 changes: 0 additions & 25 deletions
25
packages/mangrove-arbitrage/test/MgvArbitrageDeployerTest.t.sol
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
packages/mangrove-arbitrage/test/deployers/BaseMgvArbitrageDeployerTest.t.sol
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,22 @@ | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
pragma solidity ^0.8.10; | ||
|
||
import {Deployer} from "mgv_script/lib/Deployer.sol"; | ||
import {MangroveDeployer} from "mgv_script/core/deployers/MangroveDeployer.s.sol"; | ||
import {MgvArbitrageDeployer} from "script/deployers/MgvArbitrageDeployer.s.sol"; | ||
|
||
import {Test2, Test} from "mgv_lib/Test2.sol"; | ||
|
||
abstract contract BaseMgvArbitrageDeployerTest is Deployer, Test2 { | ||
MgvArbitrageDeployer mgvArbDeployer; | ||
MangroveDeployer mgvDeployer; | ||
address admin; | ||
address arbitrager; | ||
|
||
function test_toy_ens_has_addresses() public { | ||
assertEq(mgvArbDeployer.mgvArb().arbitrager(), arbitrager, "Wrong arbitrager address"); | ||
assertEq(mgvArbDeployer.mgvArb().admin(), admin, "Wrong admin address"); | ||
assertEq(address(mgvArbDeployer.mgvArb().mgv()), fork.get("Mangrove"), "Wrong mgv address"); | ||
assertEq(fork.get("MgvArbitrage"), address(mgvArbDeployer.mgvArb()), "MgvArbitrage address not correct"); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/mangrove-arbitrage/test/deployers/MgvArbitrageDeployerTest.t.sol
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,20 @@ | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
pragma solidity ^0.8.10; | ||
|
||
import {MangroveDeployer} from "mgv_script/core/deployers/MangroveDeployer.s.sol"; | ||
import {MgvArbitrageDeployer} from "script/deployers/MgvArbitrageDeployer.s.sol"; | ||
import {BaseMgvArbitrageDeployerTest} from "test/deployers/BaseMgvArbitrageDeployerTest.t.sol"; | ||
|
||
import {Test2, Test} from "mgv_lib/Test2.sol"; | ||
|
||
contract MgvArbitrageDeployerTest is BaseMgvArbitrageDeployerTest { | ||
function setUp() public { | ||
arbitrager = freshAddress("arbitrager"); | ||
admin = freshAddress("chief"); | ||
|
||
mgvDeployer = new MangroveDeployer(); | ||
mgvDeployer.innerRun({chief: admin, gasprice: 1, gasmax: 2_000_000, gasbot: address(0)}); | ||
mgvArbDeployer = new MgvArbitrageDeployer(); | ||
mgvArbDeployer.innerRun({admin: admin, arbitrager: arbitrager, mgv: address(mgvDeployer.mgv())}); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/mangrove-arbitrage/test/deployers/MumbaiMgvArbitrageDeployerTest.t.sol
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,24 @@ | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
pragma solidity ^0.8.10; | ||
|
||
import {MangroveDeployer} from "mgv_script/core/deployers/MangroveDeployer.s.sol"; | ||
import {MumbaiMgvArbitrageDeployer} from "script/deployers/MumbaiMgvArbitrageDeployer.s.sol"; | ||
import {BaseMgvArbitrageDeployerTest} from "test/deployers/BaseMgvArbitrageDeployerTest.t.sol"; | ||
|
||
import {Test2, Test} from "mgv_lib/Test2.sol"; | ||
|
||
contract MumbaiMgvArbitrageDeployerTest is BaseMgvArbitrageDeployerTest { | ||
function setUp() public { | ||
admin = broadcaster(); | ||
arbitrager = freshAddress("arbitrager"); | ||
fork.set("Arbitrager", arbitrager); | ||
|
||
mgvDeployer = new MangroveDeployer(); | ||
mgvDeployer.innerRun({chief: admin, gasprice: 1, gasmax: 2_000_000, gasbot: address(0)}); | ||
MumbaiMgvArbitrageDeployer mumbaiMgvArbitrageDeployer = new MumbaiMgvArbitrageDeployer(); | ||
|
||
mumbaiMgvArbitrageDeployer.runWithChainSpecificParams(); | ||
|
||
mgvArbDeployer = mumbaiMgvArbitrageDeployer.arbDeployer(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/mangrove-arbitrage/test/deployers/PolygonMgvArbitrageDeployerTest.t.sol
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,25 @@ | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
pragma solidity ^0.8.10; | ||
|
||
import {MangroveDeployer} from "mgv_script/core/deployers/MangroveDeployer.s.sol"; | ||
import {PolygonMgvArbitrageDeployer} from "script/deployers/PolygonMgvArbitrageDeployer.s.sol"; | ||
import {BaseMgvArbitrageDeployerTest} from "test/deployers/BaseMgvArbitrageDeployerTest.t.sol"; | ||
|
||
import {Test2, Test} from "mgv_lib/Test2.sol"; | ||
|
||
contract PolygonMgvArbitrageDeployerTest is BaseMgvArbitrageDeployerTest { | ||
function setUp() public { | ||
admin = broadcaster(); | ||
arbitrager = freshAddress("arbitrager"); | ||
fork.set("Arbitrager", arbitrager); | ||
|
||
mgvDeployer = new MangroveDeployer(); | ||
mgvDeployer.innerRun({chief: admin, gasprice: 1, gasmax: 2_000_000, gasbot: address(0)}); | ||
|
||
PolygonMgvArbitrageDeployer polygonMgvArbitrageDeployer = new PolygonMgvArbitrageDeployer(); | ||
|
||
polygonMgvArbitrageDeployer.runWithChainSpecificParams(); | ||
|
||
mgvArbDeployer = polygonMgvArbitrageDeployer.arbDeployer(); | ||
} | ||
} |