polkamarkets-js 3.2.0 → 3.3.1

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.
Files changed (149) hide show
  1. package/abis/AddAdminToLand.json +1 -0
  2. package/abis/ClaimMerkleRoot.json +1 -0
  3. package/abis/CreateLand.json +1 -0
  4. package/abis/CreateMarkets.json +1 -0
  5. package/abis/DeployContracts.json +1 -0
  6. package/abis/DeployMerkleRewardsDistributor.json +1 -0
  7. package/abis/DeployToken.json +1 -0
  8. package/abis/DeployUSDT.json +1 -0
  9. package/abis/MintTokens.json +1 -0
  10. package/abis/PredictionMarketV3_3.json +1 -0
  11. package/abis/PublishMerkleRoot.json +1 -0
  12. package/abis/ResolveMarket.json +1 -0
  13. package/abis/TradeMarket.json +1 -0
  14. package/abis/USDT.json +1 -0
  15. package/package.json +1 -1
  16. package/script/UpdateMarket.s.sol +56 -0
  17. package/scripts/AddAdminToLand.s.sol +29 -0
  18. package/scripts/ClaimMerkleRoot.s.sol +34 -0
  19. package/scripts/CreateLand.s.sol +28 -0
  20. package/scripts/CreateMarkets.s.sol +71 -0
  21. package/scripts/DeployContracts.s.sol +94 -0
  22. package/scripts/DeployMerkleRewardsDistributor.s.sol +27 -0
  23. package/scripts/DeployToken.s.sol +17 -0
  24. package/scripts/DeployUSDT.s.sol +24 -0
  25. package/scripts/MintTokens.s.sol +21 -0
  26. package/scripts/PublishMerkleRoot.s.sol +50 -0
  27. package/scripts/ResolveMarket.s.sol +23 -0
  28. package/scripts/TradeMarket.s.sol +28 -0
  29. package/scripts/UpdateMarket.s.sol +55 -0
  30. package/src/Application.js +2 -1
  31. package/src/interfaces/index.js +2 -0
  32. package/src/models/PredictionMarketV3Contract.js +5 -1
  33. package/src/models/PredictionMarketV3PlusContract.js +39 -2
  34. package/test/UpdateTest.t.sol +55 -0
  35. package/test/WhaleTest.t.sol +188 -0
  36. package/contracts/PredictionMarketV3_4Bad.sol +0 -1487
  37. package/contracts/PredictionMarketV3_4Good.sol +0 -1508
  38. package/dist/Application.d.ts +0 -201
  39. package/dist/Application.d.ts.map +0 -1
  40. package/dist/Application.js +0 -411
  41. package/dist/Application.js.map +0 -1
  42. package/dist/index.d.ts +0 -7
  43. package/dist/index.d.ts.map +0 -1
  44. package/dist/index.js +0 -16
  45. package/dist/index.js.map +0 -1
  46. package/dist/interfaces/index.d.ts +0 -4
  47. package/dist/interfaces/index.d.ts.map +0 -1
  48. package/dist/interfaces/index.js +0 -22
  49. package/dist/interfaces/index.js.map +0 -1
  50. package/dist/models/AchievementsContract.d.ts +0 -43
  51. package/dist/models/AchievementsContract.d.ts.map +0 -1
  52. package/dist/models/AchievementsContract.js +0 -177
  53. package/dist/models/AchievementsContract.js.map +0 -1
  54. package/dist/models/ArbitrationContract.d.ts +0 -23
  55. package/dist/models/ArbitrationContract.d.ts.map +0 -1
  56. package/dist/models/ArbitrationContract.js +0 -47
  57. package/dist/models/ArbitrationContract.js.map +0 -1
  58. package/dist/models/ArbitrationProxyContract.d.ts +0 -14
  59. package/dist/models/ArbitrationProxyContract.d.ts.map +0 -1
  60. package/dist/models/ArbitrationProxyContract.js +0 -26
  61. package/dist/models/ArbitrationProxyContract.js.map +0 -1
  62. package/dist/models/ERC20Contract.d.ts +0 -50
  63. package/dist/models/ERC20Contract.d.ts.map +0 -1
  64. package/dist/models/ERC20Contract.js +0 -99
  65. package/dist/models/ERC20Contract.js.map +0 -1
  66. package/dist/models/FantasyERC20Contract.d.ts +0 -13
  67. package/dist/models/FantasyERC20Contract.d.ts.map +0 -1
  68. package/dist/models/FantasyERC20Contract.js +0 -43
  69. package/dist/models/FantasyERC20Contract.js.map +0 -1
  70. package/dist/models/IContract.d.ts +0 -57
  71. package/dist/models/IContract.d.ts.map +0 -1
  72. package/dist/models/IContract.js +0 -515
  73. package/dist/models/IContract.js.map +0 -1
  74. package/dist/models/PolkamarketsSmartAccount.d.ts +0 -26
  75. package/dist/models/PolkamarketsSmartAccount.d.ts.map +0 -1
  76. package/dist/models/PolkamarketsSmartAccount.js +0 -100
  77. package/dist/models/PolkamarketsSmartAccount.js.map +0 -1
  78. package/dist/models/PredictionMarketContract.d.ts +0 -113
  79. package/dist/models/PredictionMarketContract.d.ts.map +0 -1
  80. package/dist/models/PredictionMarketContract.js +0 -298
  81. package/dist/models/PredictionMarketContract.js.map +0 -1
  82. package/dist/models/PredictionMarketV2Contract.d.ts +0 -157
  83. package/dist/models/PredictionMarketV2Contract.d.ts.map +0 -1
  84. package/dist/models/PredictionMarketV2Contract.js +0 -431
  85. package/dist/models/PredictionMarketV2Contract.js.map +0 -1
  86. package/dist/models/PredictionMarketV3Contract.d.ts +0 -42
  87. package/dist/models/PredictionMarketV3Contract.d.ts.map +0 -1
  88. package/dist/models/PredictionMarketV3Contract.js +0 -277
  89. package/dist/models/PredictionMarketV3Contract.js.map +0 -1
  90. package/dist/models/PredictionMarketV3ControllerContract.d.ts +0 -128
  91. package/dist/models/PredictionMarketV3ControllerContract.d.ts.map +0 -1
  92. package/dist/models/PredictionMarketV3ControllerContract.js +0 -174
  93. package/dist/models/PredictionMarketV3ControllerContract.js.map +0 -1
  94. package/dist/models/PredictionMarketV3FactoryContract.d.ts +0 -31
  95. package/dist/models/PredictionMarketV3FactoryContract.d.ts.map +0 -1
  96. package/dist/models/PredictionMarketV3FactoryContract.js +0 -81
  97. package/dist/models/PredictionMarketV3FactoryContract.js.map +0 -1
  98. package/dist/models/PredictionMarketV3ManagerContract.d.ts +0 -67
  99. package/dist/models/PredictionMarketV3ManagerContract.d.ts.map +0 -1
  100. package/dist/models/PredictionMarketV3ManagerContract.js +0 -97
  101. package/dist/models/PredictionMarketV3ManagerContract.js.map +0 -1
  102. package/dist/models/PredictionMarketV3QuerierContract.d.ts +0 -33
  103. package/dist/models/PredictionMarketV3QuerierContract.d.ts.map +0 -1
  104. package/dist/models/PredictionMarketV3QuerierContract.js +0 -61
  105. package/dist/models/PredictionMarketV3QuerierContract.js.map +0 -1
  106. package/dist/models/PredictionMarketV3_2Contract.d.ts +0 -32
  107. package/dist/models/PredictionMarketV3_2Contract.d.ts.map +0 -1
  108. package/dist/models/PredictionMarketV3_2Contract.js +0 -169
  109. package/dist/models/PredictionMarketV3_2Contract.js.map +0 -1
  110. package/dist/models/RealitioERC20Contract.d.ts +0 -16
  111. package/dist/models/RealitioERC20Contract.d.ts.map +0 -1
  112. package/dist/models/RealitioERC20Contract.js +0 -18
  113. package/dist/models/RealitioERC20Contract.js.map +0 -1
  114. package/dist/models/VotingContract.d.ts +0 -38
  115. package/dist/models/VotingContract.d.ts.map +0 -1
  116. package/dist/models/VotingContract.js +0 -85
  117. package/dist/models/VotingContract.js.map +0 -1
  118. package/dist/models/WETH9Contract.d.ts +0 -29
  119. package/dist/models/WETH9Contract.d.ts.map +0 -1
  120. package/dist/models/WETH9Contract.js +0 -44
  121. package/dist/models/WETH9Contract.js.map +0 -1
  122. package/dist/models/index.d.ts +0 -18
  123. package/dist/models/index.d.ts.map +0 -1
  124. package/dist/models/index.js +0 -37
  125. package/dist/models/index.js.map +0 -1
  126. package/dist/types/contracts.d.ts +0 -46
  127. package/dist/types/contracts.d.ts.map +0 -1
  128. package/dist/types/contracts.js +0 -3
  129. package/dist/types/contracts.js.map +0 -1
  130. package/dist/types/index.d.ts +0 -1
  131. package/dist/types/index.d.ts.map +0 -1
  132. package/dist/types/index.js +0 -3
  133. package/dist/types/index.js.map +0 -1
  134. package/dist/utils/Account.d.ts +0 -34
  135. package/dist/utils/Account.d.ts.map +0 -1
  136. package/dist/utils/Account.js +0 -38
  137. package/dist/utils/Account.js.map +0 -1
  138. package/dist/utils/Contract.d.ts +0 -31
  139. package/dist/utils/Contract.d.ts.map +0 -1
  140. package/dist/utils/Contract.js +0 -123
  141. package/dist/utils/Contract.js.map +0 -1
  142. package/dist/utils/Numbers.d.ts +0 -27
  143. package/dist/utils/Numbers.d.ts.map +0 -1
  144. package/dist/utils/Numbers.js +0 -87
  145. package/dist/utils/Numbers.js.map +0 -1
  146. package/script/CreateMarketLib.sol +0 -1873
  147. package/script/DeployProxy.s.sol +0 -27
  148. package/script/DeployUpgradeablePM.s.sol +0 -47
  149. package/script/PredictionMarketV3_3Flow.s.sol +0 -132
@@ -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
- }