polkamarkets-js 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abis/AddAdminToLand.json +1 -0
- package/abis/ClaimMerkleRoot.json +1 -0
- package/abis/CreateLand.json +1 -0
- package/abis/CreateMarkets.json +1 -0
- package/abis/DeployContracts.json +1 -0
- package/abis/DeployMerkleRewardsDistributor.json +1 -0
- package/abis/DeployToken.json +1 -0
- package/abis/DeployUSDT.json +1 -0
- package/abis/MintTokens.json +1 -0
- package/abis/PublishMerkleRoot.json +1 -0
- package/abis/ResolveMarket.json +1 -0
- package/abis/TradeMarket.json +1 -0
- package/abis/USDT.json +1 -0
- package/package.json +1 -1
- package/script/UpdateMarket.s.sol +56 -0
- package/scripts/AddAdminToLand.s.sol +29 -0
- package/scripts/ClaimMerkleRoot.s.sol +34 -0
- package/scripts/CreateLand.s.sol +28 -0
- package/scripts/CreateMarkets.s.sol +71 -0
- package/scripts/DeployContracts.s.sol +94 -0
- package/scripts/DeployMerkleRewardsDistributor.s.sol +27 -0
- package/scripts/DeployToken.s.sol +17 -0
- package/scripts/DeployUSDT.s.sol +24 -0
- package/scripts/MintTokens.s.sol +21 -0
- package/scripts/PublishMerkleRoot.s.sol +50 -0
- package/scripts/ResolveMarket.s.sol +23 -0
- package/scripts/TradeMarket.s.sol +28 -0
- package/scripts/UpdateMarket.s.sol +55 -0
- package/src/models/PredictionMarketV3Contract.js +5 -1
- package/test/UpdateTest.t.sol +55 -0
- package/test/WhaleTest.t.sol +188 -0
- package/contracts/PredictionMarketV3_4Bad.sol +0 -1487
- package/contracts/PredictionMarketV3_4Good.sol +0 -1508
- package/dist/Application.d.ts +0 -201
- package/dist/Application.d.ts.map +0 -1
- package/dist/Application.js +0 -411
- package/dist/Application.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -16
- package/dist/index.js.map +0 -1
- package/dist/interfaces/index.d.ts +0 -4
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/index.js +0 -22
- package/dist/interfaces/index.js.map +0 -1
- package/dist/models/AchievementsContract.d.ts +0 -43
- package/dist/models/AchievementsContract.d.ts.map +0 -1
- package/dist/models/AchievementsContract.js +0 -177
- package/dist/models/AchievementsContract.js.map +0 -1
- package/dist/models/ArbitrationContract.d.ts +0 -23
- package/dist/models/ArbitrationContract.d.ts.map +0 -1
- package/dist/models/ArbitrationContract.js +0 -47
- package/dist/models/ArbitrationContract.js.map +0 -1
- package/dist/models/ArbitrationProxyContract.d.ts +0 -14
- package/dist/models/ArbitrationProxyContract.d.ts.map +0 -1
- package/dist/models/ArbitrationProxyContract.js +0 -26
- package/dist/models/ArbitrationProxyContract.js.map +0 -1
- package/dist/models/ERC20Contract.d.ts +0 -50
- package/dist/models/ERC20Contract.d.ts.map +0 -1
- package/dist/models/ERC20Contract.js +0 -99
- package/dist/models/ERC20Contract.js.map +0 -1
- package/dist/models/FantasyERC20Contract.d.ts +0 -13
- package/dist/models/FantasyERC20Contract.d.ts.map +0 -1
- package/dist/models/FantasyERC20Contract.js +0 -43
- package/dist/models/FantasyERC20Contract.js.map +0 -1
- package/dist/models/IContract.d.ts +0 -57
- package/dist/models/IContract.d.ts.map +0 -1
- package/dist/models/IContract.js +0 -515
- package/dist/models/IContract.js.map +0 -1
- package/dist/models/PolkamarketsSmartAccount.d.ts +0 -26
- package/dist/models/PolkamarketsSmartAccount.d.ts.map +0 -1
- package/dist/models/PolkamarketsSmartAccount.js +0 -100
- package/dist/models/PolkamarketsSmartAccount.js.map +0 -1
- package/dist/models/PredictionMarketContract.d.ts +0 -113
- package/dist/models/PredictionMarketContract.d.ts.map +0 -1
- package/dist/models/PredictionMarketContract.js +0 -298
- package/dist/models/PredictionMarketContract.js.map +0 -1
- package/dist/models/PredictionMarketV2Contract.d.ts +0 -157
- package/dist/models/PredictionMarketV2Contract.d.ts.map +0 -1
- package/dist/models/PredictionMarketV2Contract.js +0 -431
- package/dist/models/PredictionMarketV2Contract.js.map +0 -1
- package/dist/models/PredictionMarketV3Contract.d.ts +0 -42
- package/dist/models/PredictionMarketV3Contract.d.ts.map +0 -1
- package/dist/models/PredictionMarketV3Contract.js +0 -277
- package/dist/models/PredictionMarketV3Contract.js.map +0 -1
- package/dist/models/PredictionMarketV3ControllerContract.d.ts +0 -128
- package/dist/models/PredictionMarketV3ControllerContract.d.ts.map +0 -1
- package/dist/models/PredictionMarketV3ControllerContract.js +0 -174
- package/dist/models/PredictionMarketV3ControllerContract.js.map +0 -1
- package/dist/models/PredictionMarketV3FactoryContract.d.ts +0 -31
- package/dist/models/PredictionMarketV3FactoryContract.d.ts.map +0 -1
- package/dist/models/PredictionMarketV3FactoryContract.js +0 -81
- package/dist/models/PredictionMarketV3FactoryContract.js.map +0 -1
- package/dist/models/PredictionMarketV3ManagerContract.d.ts +0 -67
- package/dist/models/PredictionMarketV3ManagerContract.d.ts.map +0 -1
- package/dist/models/PredictionMarketV3ManagerContract.js +0 -97
- package/dist/models/PredictionMarketV3ManagerContract.js.map +0 -1
- package/dist/models/PredictionMarketV3QuerierContract.d.ts +0 -33
- package/dist/models/PredictionMarketV3QuerierContract.d.ts.map +0 -1
- package/dist/models/PredictionMarketV3QuerierContract.js +0 -61
- package/dist/models/PredictionMarketV3QuerierContract.js.map +0 -1
- package/dist/models/PredictionMarketV3_2Contract.d.ts +0 -32
- package/dist/models/PredictionMarketV3_2Contract.d.ts.map +0 -1
- package/dist/models/PredictionMarketV3_2Contract.js +0 -169
- package/dist/models/PredictionMarketV3_2Contract.js.map +0 -1
- package/dist/models/RealitioERC20Contract.d.ts +0 -16
- package/dist/models/RealitioERC20Contract.d.ts.map +0 -1
- package/dist/models/RealitioERC20Contract.js +0 -18
- package/dist/models/RealitioERC20Contract.js.map +0 -1
- package/dist/models/VotingContract.d.ts +0 -38
- package/dist/models/VotingContract.d.ts.map +0 -1
- package/dist/models/VotingContract.js +0 -85
- package/dist/models/VotingContract.js.map +0 -1
- package/dist/models/WETH9Contract.d.ts +0 -29
- package/dist/models/WETH9Contract.d.ts.map +0 -1
- package/dist/models/WETH9Contract.js +0 -44
- package/dist/models/WETH9Contract.js.map +0 -1
- package/dist/models/index.d.ts +0 -18
- package/dist/models/index.d.ts.map +0 -1
- package/dist/models/index.js +0 -37
- package/dist/models/index.js.map +0 -1
- package/dist/types/contracts.d.ts +0 -46
- package/dist/types/contracts.d.ts.map +0 -1
- package/dist/types/contracts.js +0 -3
- package/dist/types/contracts.js.map +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/utils/Account.d.ts +0 -34
- package/dist/utils/Account.d.ts.map +0 -1
- package/dist/utils/Account.js +0 -38
- package/dist/utils/Account.js.map +0 -1
- package/dist/utils/Contract.d.ts +0 -31
- package/dist/utils/Contract.d.ts.map +0 -1
- package/dist/utils/Contract.js +0 -123
- package/dist/utils/Contract.js.map +0 -1
- package/dist/utils/Numbers.d.ts +0 -27
- package/dist/utils/Numbers.d.ts.map +0 -1
- package/dist/utils/Numbers.js +0 -87
- package/dist/utils/Numbers.js.map +0 -1
- package/script/CreateMarketLib.sol +0 -1873
- package/script/DeployProxy.s.sol +0 -27
- package/script/DeployUpgradeablePM.s.sol +0 -47
- package/script/PredictionMarketV3_3Flow.s.sol +0 -132
package/script/DeployProxy.s.sol
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.26;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
|
|
6
|
-
|
|
7
|
-
contract DeployProxy is Script {
|
|
8
|
-
// function run() external {
|
|
9
|
-
// // Your implementation address
|
|
10
|
-
// address implementation = 0xD083E4a75e676fa7777f5886fa43be7A6cc2C59A;
|
|
11
|
-
|
|
12
|
-
// // Your initialization data
|
|
13
|
-
// bytes memory initData = hex"c4d66de80000000000000000000000003439153eb7af838ad19d56e1571fbd09333c2809";
|
|
14
|
-
|
|
15
|
-
// vm.startBroadcast();
|
|
16
|
-
|
|
17
|
-
// // Deploy the proxy
|
|
18
|
-
// ERC1967Proxy proxy = new ERC1967Proxy(
|
|
19
|
-
// implementation,
|
|
20
|
-
// initData
|
|
21
|
-
// );
|
|
22
|
-
|
|
23
|
-
// vm.stopBroadcast();
|
|
24
|
-
|
|
25
|
-
// console.log("Proxy deployed at:", address(proxy));
|
|
26
|
-
// }
|
|
27
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.26;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "../contracts/PredictionMarketV3_4.sol";
|
|
6
|
-
|
|
7
|
-
contract DeployUpgradeablePM is Script {
|
|
8
|
-
// function run() public {
|
|
9
|
-
// vm.startBroadcast();
|
|
10
|
-
|
|
11
|
-
// address weth = vm.envOr("WETH_ADDRESS", address(0x3439153EB7AF838Ad19d56E1571FBD09333C2809));
|
|
12
|
-
// address payable existingProxy = payable(vm.envOr("EXISTING_PROXY_ADDRESS", address(0)));
|
|
13
|
-
|
|
14
|
-
// if (existingProxy != address(0)) {
|
|
15
|
-
// console.log("Upgrading existing proxy at:", existingProxy);
|
|
16
|
-
|
|
17
|
-
// // Deploy new implementation
|
|
18
|
-
// PredictionMarketV3_4 newImpl = new PredictionMarketV3_4();
|
|
19
|
-
// console.log("New implementation deployed at:", address(newImpl));
|
|
20
|
-
|
|
21
|
-
// // Upgrade the proxy
|
|
22
|
-
// PredictionMarketV3_4(existingProxy).upgradeTo(address(newImpl));
|
|
23
|
-
// console.log("Proxy upgraded successfully");
|
|
24
|
-
// } else {
|
|
25
|
-
// console.log("Deploying new implementation");
|
|
26
|
-
|
|
27
|
-
// // Deploy implementation
|
|
28
|
-
// PredictionMarketV3_4 impl = new PredictionMarketV3_4();
|
|
29
|
-
// console.log("Implementation deployed at:", address(impl));
|
|
30
|
-
|
|
31
|
-
// // Show initialization data for manual proxy deployment
|
|
32
|
-
// bytes memory initData = abi.encodeCall(PredictionMarketV3_4.initialize, (IWETH(weth)));
|
|
33
|
-
// console.log("WETH address:", weth);
|
|
34
|
-
// console.log("Initialization data for proxy:");
|
|
35
|
-
// console.logBytes(initData);
|
|
36
|
-
|
|
37
|
-
// console.log("\nFor proxy deployment, use OpenZeppelin's ERC1967Proxy:");
|
|
38
|
-
// console.log("new ERC1967Proxy(", vm.toString(address(impl)), ", initData)");
|
|
39
|
-
|
|
40
|
-
// // Note about contract size
|
|
41
|
-
// console.log("\nWARNING: Contract size is", 29882, "bytes, exceeding Ethereum's 24576 byte limit");
|
|
42
|
-
// console.log("This will not deploy on mainnet without optimization");
|
|
43
|
-
// }
|
|
44
|
-
|
|
45
|
-
// vm.stopBroadcast();
|
|
46
|
-
// }
|
|
47
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-2.0
|
|
2
|
-
pragma solidity ^0.8.26;
|
|
3
|
-
|
|
4
|
-
import {Script} from "forge-std/Script.sol";
|
|
5
|
-
import {console} from "forge-std/console.sol";
|
|
6
|
-
// Import your contracts here
|
|
7
|
-
import {PredictionMarketV3_4, IWETH} from "../contracts/PredictionMarketV3_4.sol";
|
|
8
|
-
import {PredictionMarketV3Manager, FantasyERC20} from "../contracts/PredictionMarketV3Manager.sol";
|
|
9
|
-
import {IPredictionMarketV3Manager} from "../contracts/IPredictionMarketV3Manager.sol";
|
|
10
|
-
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
11
|
-
import {IRealityETH_ERC20} from "../contracts/IRealityETH_ERC20.sol";
|
|
12
|
-
import {CreateMarketLib} from "./CreateMarketLib.sol";
|
|
13
|
-
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
|
|
14
|
-
import {RealityETH_ERC20_v3_0} from "@reality.eth/contracts/development/contracts/RealityETH_ERC20-3.0.sol";
|
|
15
|
-
import {IRealityETH_ERC20} from "../contracts/IRealityETH_ERC20.sol";
|
|
16
|
-
import {ERC20MinterPauser} from "../contracts/ERC20MinterPauser.sol";
|
|
17
|
-
|
|
18
|
-
struct CreateMarketDescription {
|
|
19
|
-
uint256 value;
|
|
20
|
-
uint32 closesAt;
|
|
21
|
-
uint256 outcomes;
|
|
22
|
-
IERC20 token;
|
|
23
|
-
uint256[] distribution;
|
|
24
|
-
string question;
|
|
25
|
-
string image;
|
|
26
|
-
address arbitrator;
|
|
27
|
-
Fees buyFees;
|
|
28
|
-
Fees sellFees;
|
|
29
|
-
address treasury;
|
|
30
|
-
address distributor;
|
|
31
|
-
uint32 realitioTimeout;
|
|
32
|
-
IPredictionMarketV3Manager manager;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
struct Fees {
|
|
37
|
-
uint256 fee; // fee % taken from every transaction
|
|
38
|
-
uint256 treasuryFee; // fee % taken from every transaction to a treasury address
|
|
39
|
-
uint256 distributorFee; // fee % taken from every transaction to a distributor address
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
contract PredictionMarketV33Flow is Script {
|
|
43
|
-
using CreateMarketLib for address;
|
|
44
|
-
|
|
45
|
-
function run() public {
|
|
46
|
-
|
|
47
|
-
vm.startBroadcast();
|
|
48
|
-
|
|
49
|
-
address payable PREDICTION_MARKET_V3_4 = payable(address(0x39E66eE6b2ddaf4DEfDEd3038E0162180dbeF340));
|
|
50
|
-
// address PREDICTION_MARKET_V3_MANAGER = address(0x1192F125C3a269834A3b59775CeB37889C9DCC4d);
|
|
51
|
-
address PREDICTION_MARKET_V3_MANAGER = address(0xDeFb36c47754D2e37d44b8b8C647D4D643e03bAd);
|
|
52
|
-
address REALITIO = address(0xDcBe79f74c98368141798eA0b7b979B9bA54b026);
|
|
53
|
-
address WETH = address(0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f);
|
|
54
|
-
address admin = address(0x7836D709E750F6A2D6ff9362457028e8Cd901EB3);
|
|
55
|
-
address TOKEN = address(0x60d7956805eC5A698173def4D0e1ecDeFb06cC57);
|
|
56
|
-
address TOKEN_2 = address(0x176211869cA2b568f2A7D4EE941E073a821EE1ff);
|
|
57
|
-
|
|
58
|
-
// deploy PredictionMarketV3_4
|
|
59
|
-
// address payable PREDICTION_MARKET_V3_4;
|
|
60
|
-
// PredictionMarketV3_4 impl = new PredictionMarketV3_4();
|
|
61
|
-
// console.log("Implementation deployed at:", address(impl));
|
|
62
|
-
|
|
63
|
-
// // // // Show initialization data for manual proxy deployment
|
|
64
|
-
// bytes memory initData = abi.encodeCall(PredictionMarketV3_4.initialize, (IWETH(WETH), admin));
|
|
65
|
-
// console.log("Initialization data for proxy:");
|
|
66
|
-
// console.logBytes(initData);
|
|
67
|
-
|
|
68
|
-
// console.log("\nFor proxy deployment, use OpenZeppelin's ERC1967Proxy:");
|
|
69
|
-
// console.log("new ERC1967Proxy(", vm.toString(address(impl)), ", initData)");
|
|
70
|
-
|
|
71
|
-
// ERC1967Proxy proxy = new ERC1967Proxy(
|
|
72
|
-
// address(impl),
|
|
73
|
-
// initData
|
|
74
|
-
// );
|
|
75
|
-
|
|
76
|
-
// console.log("PredictionMarketV3_4 deployed at:", address(proxy));
|
|
77
|
-
// PREDICTION_MARKET_V3_4 = payable(address(proxy));
|
|
78
|
-
|
|
79
|
-
// deploy TOKEN
|
|
80
|
-
// ERC20MinterPauser token = new ERC20MinterPauser("Myriad Cure", "MYRCURE");
|
|
81
|
-
// console.log("TOKEN deployed at:", address(token));
|
|
82
|
-
// TOKEN = address(token);
|
|
83
|
-
// token.mint(admin, 10000000000000000000);
|
|
84
|
-
|
|
85
|
-
// deploy RealityETH_ERC20
|
|
86
|
-
// RealityETH_ERC20_v3_0 realitio = new RealityETH_ERC20_v3_0();
|
|
87
|
-
// console.log("RealityETH_ERC20 deployed at:", address(realitio));
|
|
88
|
-
// IRealityETH_ERC20(address(realitio)).setToken(address(TOKEN));
|
|
89
|
-
// REALITIO = address(realitio);
|
|
90
|
-
|
|
91
|
-
// // deploy PredictionMarketV3_4Manager
|
|
92
|
-
// PredictionMarketV3Manager manager = new PredictionMarketV3Manager(
|
|
93
|
-
// PREDICTION_MARKET_V3_4,
|
|
94
|
-
// IERC20(TOKEN),
|
|
95
|
-
// 1 ether,
|
|
96
|
-
// address(REALITIO),
|
|
97
|
-
// admin
|
|
98
|
-
// );
|
|
99
|
-
// console.log("PredictionMarketV3Manager deployed at:", address(manager));
|
|
100
|
-
// PREDICTION_MARKET_V3_MANAGER = address(manager);
|
|
101
|
-
|
|
102
|
-
// IERC20(TOKEN).approve(PREDICTION_MARKET_V3_MANAGER, 1000 ether);
|
|
103
|
-
// PredictionMarketV3_4(PREDICTION_MARKET_V3_4).setAllowedManager(PREDICTION_MARKET_V3_MANAGER, true);
|
|
104
|
-
|
|
105
|
-
// PredictionMarketV3Manager(PREDICTION_MARKET_V3_MANAGER).createLand(
|
|
106
|
-
// IERC20(TOKEN_2),
|
|
107
|
-
// IERC20(TOKEN)
|
|
108
|
-
// );
|
|
109
|
-
|
|
110
|
-
PredictionMarketV3Manager(PREDICTION_MARKET_V3_MANAGER).addAdminToLand(IERC20(TOKEN_2), 0xa7bb496326B0DDe7Cfe153BBF16098Eb16b06fa4);
|
|
111
|
-
PredictionMarketV3Manager(PREDICTION_MARKET_V3_MANAGER).addAdminToLand(IERC20(TOKEN_2), 0x5F9eC8B7ACcB856B32578f5B4eDf308539616B08);
|
|
112
|
-
PredictionMarketV3Manager(PREDICTION_MARKET_V3_MANAGER).addAdminToLand(IERC20(TOKEN_2), 0xC5A3EFc6F59A74FB2e32ba9421759Aa5424fccD4);
|
|
113
|
-
|
|
114
|
-
// PredictionMarketV3Manager(PREDICTION_MARKET_V3_MANAGER).createLand(
|
|
115
|
-
// FantasyERC20(TOKEN_2),
|
|
116
|
-
// IERC20(TOKEN)
|
|
117
|
-
// );
|
|
118
|
-
|
|
119
|
-
// // approve token
|
|
120
|
-
// IERC20(TOKEN).approve(PREDICTION_MARKET_V3_4, 1000000000000000000000000000000000000000);
|
|
121
|
-
IERC20(TOKEN_2).approve(PREDICTION_MARKET_V3_4, 1000000000000000000000000000000000000000);
|
|
122
|
-
|
|
123
|
-
// create markets
|
|
124
|
-
CreateMarketLib.createMarket(
|
|
125
|
-
PREDICTION_MARKET_V3_4,
|
|
126
|
-
PREDICTION_MARKET_V3_MANAGER,
|
|
127
|
-
TOKEN_2
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
vm.stopBroadcast();
|
|
131
|
-
}
|
|
132
|
-
}
|