quantumswap 0.0.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 (77) hide show
  1. package/.github/workflows/publish-npmjs.yaml +22 -0
  2. package/LICENSE +21 -0
  3. package/README.md +287 -0
  4. package/examples/_test-wallet.js +17 -0
  5. package/examples/deploy-IERC20.js +23 -0
  6. package/examples/deploy-QuantumSwapV2ERC20.js +23 -0
  7. package/examples/deploy-QuantumSwapV2Factory.js +23 -0
  8. package/examples/deploy-QuantumSwapV2Pair.js +23 -0
  9. package/examples/deploy-QuantumSwapV2Router02.js +23 -0
  10. package/examples/deploy-WQ.js +23 -0
  11. package/examples/events-IERC20.js +20 -0
  12. package/examples/events-QuantumSwapV2ERC20.js +20 -0
  13. package/examples/events-QuantumSwapV2Factory.js +20 -0
  14. package/examples/events-QuantumSwapV2Pair.js +20 -0
  15. package/examples/events-QuantumSwapV2Router02.js +20 -0
  16. package/examples/events-WQ.js +20 -0
  17. package/examples/offline-signing-IERC20.js +29 -0
  18. package/examples/offline-signing-QuantumSwapV2ERC20.js +29 -0
  19. package/examples/offline-signing-QuantumSwapV2Factory.js +29 -0
  20. package/examples/offline-signing-QuantumSwapV2Pair.js +29 -0
  21. package/examples/offline-signing-QuantumSwapV2Router02.js +29 -0
  22. package/examples/offline-signing-WQ.js +29 -0
  23. package/examples/read-operations-IERC20.js +19 -0
  24. package/examples/read-operations-QuantumSwapV2ERC20.js +19 -0
  25. package/examples/read-operations-QuantumSwapV2Factory.js +19 -0
  26. package/examples/read-operations-QuantumSwapV2Pair.js +19 -0
  27. package/examples/read-operations-QuantumSwapV2Router02.js +19 -0
  28. package/examples/read-operations-WQ.js +19 -0
  29. package/examples/walkthrough-dex-full-flow.js +226 -0
  30. package/examples/walkthrough-dex-full-flow.ts +231 -0
  31. package/examples/write-operations-IERC20.js +22 -0
  32. package/examples/write-operations-QuantumSwapV2ERC20.js +22 -0
  33. package/examples/write-operations-QuantumSwapV2Factory.js +22 -0
  34. package/examples/write-operations-QuantumSwapV2Pair.js +22 -0
  35. package/examples/write-operations-QuantumSwapV2Router02.js +22 -0
  36. package/examples/write-operations-WQ.js +22 -0
  37. package/index.d.ts +1 -0
  38. package/index.js +45 -0
  39. package/package.json +35 -0
  40. package/src/IERC20.d.ts +24 -0
  41. package/src/IERC20.js +348 -0
  42. package/src/IERC20__factory.d.ts +10 -0
  43. package/src/IERC20__factory.js +29 -0
  44. package/src/QuantumSwapV2ERC20.d.ts +24 -0
  45. package/src/QuantumSwapV2ERC20.js +353 -0
  46. package/src/QuantumSwapV2ERC20__factory.d.ts +10 -0
  47. package/src/QuantumSwapV2ERC20__factory.js +29 -0
  48. package/src/QuantumSwapV2Factory.d.ts +24 -0
  49. package/src/QuantumSwapV2Factory.js +310 -0
  50. package/src/QuantumSwapV2Factory__factory.d.ts +10 -0
  51. package/src/QuantumSwapV2Factory__factory.js +29 -0
  52. package/src/QuantumSwapV2Pair.d.ts +44 -0
  53. package/src/QuantumSwapV2Pair.js +847 -0
  54. package/src/QuantumSwapV2Pair__factory.d.ts +10 -0
  55. package/src/QuantumSwapV2Pair__factory.js +29 -0
  56. package/src/QuantumSwapV2Router02.d.ts +47 -0
  57. package/src/QuantumSwapV2Router02.js +1109 -0
  58. package/src/QuantumSwapV2Router02__factory.d.ts +10 -0
  59. package/src/QuantumSwapV2Router02__factory.js +29 -0
  60. package/src/WQ.d.ts +28 -0
  61. package/src/WQ.js +435 -0
  62. package/src/WQ__factory.d.ts +10 -0
  63. package/src/WQ__factory.js +29 -0
  64. package/src/index.d.ts +14 -0
  65. package/src/index.js +15 -0
  66. package/src/quantumcoin-shims.d.ts +25 -0
  67. package/src/types.d.ts +3 -0
  68. package/src/types.js +3 -0
  69. package/test/e2e/IERC20.e2e.test.js +79 -0
  70. package/test/e2e/QuantumSwapV2ERC20.e2e.test.js +79 -0
  71. package/test/e2e/QuantumSwapV2Factory.e2e.test.js +79 -0
  72. package/test/e2e/QuantumSwapV2Pair.e2e.test.js +79 -0
  73. package/test/e2e/QuantumSwapV2Router02.e2e.test.js +79 -0
  74. package/test/e2e/WQ.e2e.test.js +79 -0
  75. package/test/e2e/all-contracts.e2e.test.js +103 -0
  76. package/test/e2e/dex-full-flow.e2e.test.js +353 -0
  77. package/tsconfig.json +14 -0
@@ -0,0 +1,310 @@
1
+ // Auto-generated by sdkgen
2
+ const { Contract } = require("quantumcoin");
3
+
4
+ /**
5
+ * QuantumSwapV2Factory - A typed contract interface for QuantumSwapV2Factory
6
+ */
7
+ class QuantumSwapV2Factory extends Contract {
8
+ static abi = [
9
+ {
10
+ "inputs": [
11
+ {
12
+ "internalType": "address",
13
+ "name": "_feeToSetter",
14
+ "type": "address"
15
+ }
16
+ ],
17
+ "stateMutability": "nonpayable",
18
+ "type": "constructor"
19
+ },
20
+ {
21
+ "anonymous": false,
22
+ "inputs": [
23
+ {
24
+ "indexed": true,
25
+ "internalType": "address",
26
+ "name": "token0",
27
+ "type": "address"
28
+ },
29
+ {
30
+ "indexed": true,
31
+ "internalType": "address",
32
+ "name": "token1",
33
+ "type": "address"
34
+ },
35
+ {
36
+ "indexed": false,
37
+ "internalType": "address",
38
+ "name": "pair",
39
+ "type": "address"
40
+ },
41
+ {
42
+ "indexed": false,
43
+ "internalType": "uint256",
44
+ "name": "",
45
+ "type": "uint256"
46
+ }
47
+ ],
48
+ "name": "PairCreated",
49
+ "type": "event"
50
+ },
51
+ {
52
+ "inputs": [],
53
+ "name": "INIT_CODE_HASH",
54
+ "outputs": [
55
+ {
56
+ "internalType": "bytes32",
57
+ "name": "",
58
+ "type": "bytes32"
59
+ }
60
+ ],
61
+ "stateMutability": "view",
62
+ "type": "function"
63
+ },
64
+ {
65
+ "inputs": [
66
+ {
67
+ "internalType": "uint256",
68
+ "name": "",
69
+ "type": "uint256"
70
+ }
71
+ ],
72
+ "name": "allPairs",
73
+ "outputs": [
74
+ {
75
+ "internalType": "address",
76
+ "name": "",
77
+ "type": "address"
78
+ }
79
+ ],
80
+ "stateMutability": "view",
81
+ "type": "function"
82
+ },
83
+ {
84
+ "inputs": [],
85
+ "name": "allPairsLength",
86
+ "outputs": [
87
+ {
88
+ "internalType": "uint256",
89
+ "name": "",
90
+ "type": "uint256"
91
+ }
92
+ ],
93
+ "stateMutability": "view",
94
+ "type": "function"
95
+ },
96
+ {
97
+ "inputs": [
98
+ {
99
+ "internalType": "address",
100
+ "name": "tokenA",
101
+ "type": "address"
102
+ },
103
+ {
104
+ "internalType": "address",
105
+ "name": "tokenB",
106
+ "type": "address"
107
+ }
108
+ ],
109
+ "name": "createPair",
110
+ "outputs": [
111
+ {
112
+ "internalType": "address",
113
+ "name": "pair",
114
+ "type": "address"
115
+ }
116
+ ],
117
+ "stateMutability": "nonpayable",
118
+ "type": "function"
119
+ },
120
+ {
121
+ "inputs": [],
122
+ "name": "feeTo",
123
+ "outputs": [
124
+ {
125
+ "internalType": "address",
126
+ "name": "",
127
+ "type": "address"
128
+ }
129
+ ],
130
+ "stateMutability": "view",
131
+ "type": "function"
132
+ },
133
+ {
134
+ "inputs": [],
135
+ "name": "feeToSetter",
136
+ "outputs": [
137
+ {
138
+ "internalType": "address",
139
+ "name": "",
140
+ "type": "address"
141
+ }
142
+ ],
143
+ "stateMutability": "view",
144
+ "type": "function"
145
+ },
146
+ {
147
+ "inputs": [
148
+ {
149
+ "internalType": "address",
150
+ "name": "",
151
+ "type": "address"
152
+ },
153
+ {
154
+ "internalType": "address",
155
+ "name": "",
156
+ "type": "address"
157
+ }
158
+ ],
159
+ "name": "getPair",
160
+ "outputs": [
161
+ {
162
+ "internalType": "address",
163
+ "name": "",
164
+ "type": "address"
165
+ }
166
+ ],
167
+ "stateMutability": "view",
168
+ "type": "function"
169
+ },
170
+ {
171
+ "inputs": [
172
+ {
173
+ "internalType": "address",
174
+ "name": "_feeTo",
175
+ "type": "address"
176
+ }
177
+ ],
178
+ "name": "setFeeTo",
179
+ "outputs": [],
180
+ "stateMutability": "nonpayable",
181
+ "type": "function"
182
+ },
183
+ {
184
+ "inputs": [
185
+ {
186
+ "internalType": "address",
187
+ "name": "_feeToSetter",
188
+ "type": "address"
189
+ }
190
+ ],
191
+ "name": "setFeeToSetter",
192
+ "outputs": [],
193
+ "stateMutability": "nonpayable",
194
+ "type": "function"
195
+ }
196
+ ];
197
+ static bytecode = "0x608060405234801561001057600080fd5b506040516130e93803806130e98339818101604052602081101561003357600080fd5b8101908080519060200190929190505050806001819055505061308e8061005b6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063574f2ba311610066578063574f2ba314610134578063a2e74af614610152578063c9c6539614610180578063e6a43905146101cc578063f46901ed1461021857610093565b8063017e7e5814610098578063094b7415146100b65780631e3dd18b146100d4578063257671f514610116575b600080fd5b6100a0610246565b6040518082815260200191505060405180910390f35b6100be61024c565b6040518082815260200191505060405180910390f35b610100600480360360208110156100ea57600080fd5b8101908080359060200190929190505050610252565b6040518082815260200191505060405180910390f35b61011e610276565b6040518082815260200191505060405180910390f35b61013c61030e565b6040518082815260200191505060405180910390f35b61017e6004803603602081101561016857600080fd5b810190808035906020019092919050505061031b565b005b6101b66004803603604081101561019657600080fd5b81019080803590602001909291908035906020019092919050505061039c565b6040518082815260200191505060405180910390f35b610202600480360360408110156101e257600080fd5b8101908080359060200190929190803590602001909291905050506106cc565b6040518082815260200191505060405180910390f35b6102446004803603602081101561022e57600080fd5b81019080803590602001909291905050506106f1565b005b60005481565b60015481565b6003818154811061026257600080fd5b906000526020600020016000915090505481565b6040518060200161028690610772565b6020820181038252601f19601f820116604052506040516020018082805190602001908083835b602083106102d057805182526020820191506020810190506020830392506102ad565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040528051906020012081565b6000600380549050905090565b6001543314610392576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f556e697377617056323a20464f5242494444454e00000000000000000000000081525060200191505060405180910390fd5b8060018190555050565b600081831415610414576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f556e697377617056323a204944454e544943414c5f414444524553534553000081525060200191505060405180910390fd5b600080838510610425578385610428565b84845b9150915060008214156104a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f556e697377617056323a205a45524f5f4144445245535300000000000000000081525060200191505060405180910390fd5b6000600260008481526020019081526020016000206000838152602001908152602001600020541461053d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f556e697377617056323a20504149525f4558495354530000000000000000000081525060200191505060405180910390fd5b60006040518060200161054f90610772565b6020820181038252601f19601f820116604052509050600083836040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209050808251602084016000f594508463485cc95585856040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b1580156105e957600080fd5b505af11580156105fd573d6000803e3d6000fd5b5050505084600260008681526020019081526020016000206000858152602001908152602001600020819055508460026000858152602001908152602001600020600086815260200190815260200160002081905550600385908060018154018082558091505060019003906000526020600020016000909190919091505582847f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e987600380549050604051808381526020018281526020019250505060405180910390a35050505092915050565b6002602052816000526040600020602052806000526040600020600091509150505481565b6001543314610768576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f556e697377617056323a20464f5242494444454e00000000000000000000000081525060200191505060405180910390fd5b8060008190555050565b6128d9806107808339019056fe60806040526001600a5534801561001557600080fd5b50600046905050336003819055506128a7806100326000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c80636a627842116100c3578063ba9a7a561161007c578063ba9a7a56146105f1578063bc25cf771461060f578063c45a01551461063d578063d21220a71461065b578063dd62ed3e14610679578063fff6cae9146106c55761014d565b80636a6278421461043557806370a08231146104775780637464fc3d146104b957806389afcb44146104d757806395d89b4114610520578063a9059cbb146105a35761014d565b806318160ddd1161011557806318160ddd1461032a57806323b872dd14610348578063313ce567146103a0578063485cc955146103c15780635909c0d5146103f95780635a3d5493146104175761014d565b8063022c0d9f1461015257806306fdde03146101e95780630902f1ac1461026c578063095ea7b3146102be5780630dfe16811461030c575b600080fd5b6101e76004803603608081101561016857600080fd5b81019080803590602001909291908035906020019092919080359060200190929190803590602001906401000000008111156101a357600080fd5b8201836020820111156101b557600080fd5b803590602001918460018302840111640100000000831117156101d757600080fd5b90919293919293905050506106cf565b005b6101f1610d32565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610231578082015181840152602081019050610216565b50505050905090810190601f16801561025e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610274610d6b565b60405180846dffffffffffffffffffffffffffff168152602001836dffffffffffffffffffffffffffff1681526020018263ffffffff168152602001935050505060405180910390f35b6102f4600480360360408110156102d457600080fd5b810190808035906020019092919080359060200190929190505050610dc8565b60405180821515815260200191505060405180910390f35b610314610ddf565b6040518082815260200191505060405180910390f35b610332610de5565b6040518082815260200191505060405180910390f35b6103886004803603606081101561035e57600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050610deb565b60405180821515815260200191505060405180910390f35b6103a8610eae565b604051808260ff16815260200191505060405180910390f35b6103f7600480360360408110156103d757600080fd5b810190808035906020019092919080359060200190929190505050610eb3565b005b610401610f3c565b6040518082815260200191505060405180910390f35b61041f610f42565b6040518082815260200191505060405180910390f35b6104616004803603602081101561044b57600080fd5b8101908080359060200190929190505050610f48565b6040518082815260200191505060405180910390f35b6104a36004803603602081101561048d57600080fd5b810190808035906020019092919050505061131f565b6040518082815260200191505060405180910390f35b6104c1611337565b6040518082815260200191505060405180910390f35b610503600480360360208110156104ed57600080fd5b810190808035906020019092919050505061133d565b604051808381526020018281526020019250505060405180910390f35b61052861178a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561056857808201518184015260208101905061054d565b50505050905090810190601f1680156105955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105d9600480360360408110156105b957600080fd5b8101908080359060200190929190803590602001909291905050506117c3565b60405180821515815260200191505060405180910390f35b6105f96117da565b6040518082815260200191505060405180910390f35b61063b6004803603602081101561062557600080fd5b81019080803590602001909291905050506117e0565b005b6106456119f7565b6040518082815260200191505060405180910390f35b6106636119fd565b6040518082815260200191505060405180910390f35b6106af6004803603604081101561068f57600080fd5b810190808035906020019092919080359060200190929190505050611a03565b6040518082815260200191505060405180910390f35b6106cd611a28565b005b6001600a5414610747576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f556e697377617056323a204c4f434b454400000000000000000000000000000081525060200191505060405180910390fd5b6000600a81905550600085118061075e5750600084115b6107b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806127b86025913960400191505060405180910390fd5b6000806107be610d6b565b5091509150816dffffffffffffffffffffffffffff16871080156107f15750806dffffffffffffffffffffffffffff1686105b610846576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806128016021913960400191505060405180910390fd5b60008060006004549050600060055490508189141580156108675750808914155b6108d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e697377617056323a20494e56414c49445f544f000000000000000000000081525060200191505060405180910390fd5b60008b11156108ee576108ed828a8d611be4565b5b60008a111561090357610902818a8c611be4565b5b60008888905011156109a957886310d1e85c338d8d8c8c6040518663ffffffff1660e01b815260040180868152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b15801561099057600080fd5b505af11580156109a4573d6000803e3d6000fd5b505050505b816370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156109e457600080fd5b505afa1580156109f8573d6000803e3d6000fd5b505050506040513d6020811015610a0e57600080fd5b81019080805190602001909291905050509350806370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610a5c57600080fd5b505afa158015610a70573d6000803e3d6000fd5b505050506040513d6020811015610a8657600080fd5b810190808051906020019092919050505092505050600089856dffffffffffffffffffffffffffff16038311610abd576000610ad3565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610af7576000610b0d565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b1e5750600081115b610b73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806127dd6024913960400191505060405180910390fd5b6000610baf610b8c600385611dee90919063ffffffff16565b610ba16103e888611dee90919063ffffffff16565b611e8390919063ffffffff16565b90506000610bed610bca600385611dee90919063ffffffff16565b610bdf6103e888611dee90919063ffffffff16565b611e8390919063ffffffff16565b9050610c37620f4240610c29896dffffffffffffffffffffffffffff168b6dffffffffffffffffffffffffffff16611dee90919063ffffffff16565b611dee90919063ffffffff16565b610c4a8284611dee90919063ffffffff16565b1015610cbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f556e697377617056323a204b000000000000000000000000000000000000000081525060200191505060405180910390fd5b5050610ccc84848888611f06565b88337fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d82284848f8f6040518085815260200184815260200183815260200182815260200194505050505060405180910390a35050505050506001600a819055505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6000806000600660009054906101000a90046dffffffffffffffffffffffffffff1692506006600e9054906101000a90046dffffffffffffffffffffffffffff1691506006601c9054906101000a900463ffffffff169050909192565b6000610dd5338484612264565b6001905092915050565b60045481565b60005481565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6002600086815260200190815260200160002060003381526020019081526020016000205414610e9857610e6f8260026000878152602001908152602001600020600033815260200190815260200160002054611e8390919063ffffffff16565b600260008681526020019081526020016000206000338152602001908152602001600020819055505b610ea38484846122cb565b600190509392505050565b601281565b6003543314610f2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f556e697377617056323a20464f5242494444454e00000000000000000000000081525060200191505060405180910390fd5b81600481905550806005819055505050565b60075481565b60085481565b60006001600a5414610fc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f556e697377617056323a204c4f434b454400000000000000000000000000000081525060200191505060405180910390fd5b6000600a81905550600080610fd5610d6b565b509150915060006004546370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561101957600080fd5b505afa15801561102d573d6000803e3d6000fd5b505050506040513d602081101561104357600080fd5b8101908080519060200190929190505050905060006005546370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561109557600080fd5b505afa1580156110a9573d6000803e3d6000fd5b505050506040513d60208110156110bf57600080fd5b8101908080519060200190929190505050905060006110f7856dffffffffffffffffffffffffffff1684611e8390919063ffffffff16565b9050600061111e856dffffffffffffffffffffffffffff1684611e8390919063ffffffff16565b9050600061112c8787612383565b905060008054905060008114156111805761116c6103e861115e6111598688611dee90919063ffffffff16565b612502565b611e8390919063ffffffff16565b985061117b60006103e8612564565b6111e3565b6111e0886dffffffffffffffffffffffffffff166111a78387611dee90919063ffffffff16565b816111ae57fe5b04886dffffffffffffffffffffffffffff166111d38487611dee90919063ffffffff16565b816111da57fe5b046125fa565b98505b6000891161123c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061284a6028913960400191505060405180910390fd5b6112468a8a612564565b61125286868a8a611f06565b81156112ca576112c36006600e9054906101000a90046dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16600660009054906101000a90046dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16611dee90919063ffffffff16565b6009819055505b337f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f8585604051808381526020018281526020019250505060405180910390a250505050505050506001600a81905550919050565b60016020528060005260406000206000915090505481565b60095481565b6000806001600a54146113b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f556e697377617056323a204c4f434b454400000000000000000000000000000081525060200191505060405180910390fd5b6000600a819055506000806113cb610d6b565b509150915060006004549050600060055490506000826370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561141b57600080fd5b505afa15801561142f573d6000803e3d6000fd5b505050506040513d602081101561144557600080fd5b810190808051906020019092919050505090506000826370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561149557600080fd5b505afa1580156114a9573d6000803e3d6000fd5b505050506040513d60208110156114bf57600080fd5b8101908080519060200190929190505050905060006001600030815260200190815260200160002054905060006114f68888612383565b9050600080549050806115128685611dee90919063ffffffff16565b8161151957fe5b049a50806115308585611dee90919063ffffffff16565b8161153757fe5b04995060008b11801561154a575060008a115b61159f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806128226028913960400191505060405180910390fd5b6115a93084612613565b6115b4878d8d611be4565b6115bf868d8c611be4565b866370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156115fa57600080fd5b505afa15801561160e573d6000803e3d6000fd5b505050506040513d602081101561162457600080fd5b81019080805190602001909291905050509450856370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561167257600080fd5b505afa158015611686573d6000803e3d6000fd5b505050506040513d602081101561169c57600080fd5b810190808051906020019092919050505093506116bb85858b8b611f06565b81156117335761172c6006600e9054906101000a90046dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16600660009054906101000a90046dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16611dee90919063ffffffff16565b6009819055505b8b337fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d819364968d8d604051808381526020018281526020019250505060405180910390a35050505050505050506001600a81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b60006117d03384846122cb565b6001905092915050565b6103e881565b6001600a5414611858576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f556e697377617056323a204c4f434b454400000000000000000000000000000081525060200191505060405180910390fd5b6000600a81905550600060045490506000600554905061192c8284611927600660009054906101000a90046dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16866370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156118de57600080fd5b505afa1580156118f2573d6000803e3d6000fd5b505050506040513d602081101561190857600080fd5b8101908080519060200190929190505050611e8390919063ffffffff16565b611be4565b6119ea81846119e56006600e9054906101000a90046dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16856370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561199c57600080fd5b505afa1580156119b0573d6000803e3d6000fd5b505050506040513d60208110156119c657600080fd5b8101908080519060200190929190505050611e8390919063ffffffff16565b611be4565b50506001600a8190555050565b60035481565b60055481565b6002602052816000526040600020602052806000526040600020600091509150505481565b6001600a5414611aa0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f556e697377617056323a204c4f434b454400000000000000000000000000000081525060200191505060405180910390fd5b6000600a81905550611bda6004546370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611ae857600080fd5b505afa158015611afc573d6000803e3d6000fd5b505050506040513d6020811015611b1257600080fd5b81019080805190602001909291905050506005546370a08231306040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611b6057600080fd5b505afa158015611b74573d6000803e3d6000fd5b505050506040513d6020811015611b8a57600080fd5b8101908080519060200190929190505050600660009054906101000a90046dffffffffffffffffffffffffffff166006600e9054906101000a90046dffffffffffffffffffffffffffff16611f06565b6001600a81905550565b600080846040518060400160405280601981526020017f7472616e7366657228616464726573732c75696e7432353629000000000000008152508051906020012085856040516024018083815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611cce5780518252602082019150602081019050602083039250611cab565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611d30576040519150601f19603f3d011682016040523d82523d6000602084013e611d35565b606091505b5091509150818015611d755750600081511480611d745750808060200190516020811015611d6257600080fd5b81019080805190602001909291905050505b5b611de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f556e697377617056323a205452414e534645525f4641494c454400000000000081525060200191505060405180910390fd5b5050505050565b600080821480611e0b5750828283850292508281611e0857fe5b04145b611e7d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6d756c2d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b6000828284039150811115611f00576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f64732d6d6174682d7375622d756e646572666c6f77000000000000000000000081525060200191505060405180910390fd5b92915050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6dffffffffffffffffffffffffffff168411158015611f7657507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6dffffffffffffffffffffffffffff168311155b611fe8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e697377617056323a204f564552464c4f570000000000000000000000000081525060200191505060405180910390fd5b60006401000000004281611ff857fe5b06905060006006601c9054906101000a900463ffffffff168203905060008163ffffffff1611801561203b57506000846dffffffffffffffffffffffffffff1614155b801561205857506000836dffffffffffffffffffffffffffff1614155b1561213a578063ffffffff1661209d85612071866126a9565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166126d490919063ffffffff16565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16026007600082825401925050819055508063ffffffff1661210b846120df876126a9565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166126d490919063ffffffff16565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16026008600082825401925050819055505b85600660006101000a8154816dffffffffffffffffffffffffffff02191690836dffffffffffffffffffffffffffff160217905550846006600e6101000a8154816dffffffffffffffffffffffffffff02191690836dffffffffffffffffffffffffffff160217905550816006601c6101000a81548163ffffffff021916908363ffffffff1602179055507f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1600660009054906101000a90046dffffffffffffffffffffffffffff166006600e9054906101000a90046dffffffffffffffffffffffffffff1660405180836dffffffffffffffffffffffffffff168152602001826dffffffffffffffffffffffffffff1681526020019250505060405180910390a1505050505050565b806002600085815260200190815260200160002060008481526020019081526020016000208190555081837f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6122f1816001600086815260200190815260200160002054611e8390919063ffffffff16565b600160008581526020019081526020016000208190555061232e81600160008581526020019081526020016000205461273490919063ffffffff16565b600160008481526020019081526020016000208190555081837fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008060035463017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b1580156123b857600080fd5b505afa1580156123cc573d6000803e3d6000fd5b505050506040513d60208110156123e257600080fd5b81019080805190602001909291905050509050600081141591506000600954905082156124e857600081146124e357600061244e612449866dffffffffffffffffffffffffffff16886dffffffffffffffffffffffffffff16611dee90919063ffffffff16565b612502565b9050600061245b83612502565b9050808211156124e057600061248e61247d8385611e8390919063ffffffff16565b600054611dee90919063ffffffff16565b905060006124b8836124aa600587611dee90919063ffffffff16565b61273490919063ffffffff16565b905060008183816124c557fe5b04905060008111156124dc576124db8782612564565b5b5050505b50505b6124fa565b600081146124f95760006009819055505b5b505092915050565b6000600382111561255157819050600060016002848161251e57fe5b040190505b8181101561254b5780915060028182858161253a57fe5b04018161254357fe5b049050612523565b5061255f565b6000821461255e57600190505b5b919050565b6125798160005461273490919063ffffffff16565b6000819055506125a581600160008581526020019081526020016000205461273490919063ffffffff16565b60016000848152602001908152602001600020819055508160007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000818310612609578161260b565b825b905092915050565b612639816001600085815260200190815260200160002054611e8390919063ffffffff16565b600160008481526020019081526020016000208190555061266581600054611e8390919063ffffffff16565b6000819055506000827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60006e010000000000000000000000000000826dffffffffffffffffffffffffffff16029050919050565b6000816dffffffffffffffffffffffffffff167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168161272b57fe5b04905092915050565b60008282840191508110156127b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6164642d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b9291505056fe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a26469706673582212208806423f0561522375d4d15ba3785948c0b250d0817eaf87b4f8edb4afe4b90864736f6c63430007060033a264697066735822122069019874b2b7df6756f0b5c139f66280f9a9122dc5afce532237ada0bd939e5c64736f6c63430007060033";
198
+
199
+ static connect(address, runner) {
200
+ return new QuantumSwapV2Factory(address, runner);
201
+ }
202
+
203
+ constructor(address, runner, _deployTx) {
204
+ super(address, QuantumSwapV2Factory.abi, runner, QuantumSwapV2Factory.bytecode);
205
+ this._deployTx = _deployTx;
206
+
207
+ // Typed populateTransaction helpers (offline signing / sendRawTransaction flows)
208
+ this.populateTransaction = {
209
+ createPair: async (tokenA, tokenB, overrides) => {
210
+ const data = this.interface.encodeFunctionData("createPair", [tokenA, tokenB]);
211
+ return { to: this.address, data, ...(overrides || {}) };
212
+ },
213
+ setFeeTo: async (_feeTo, overrides) => {
214
+ const data = this.interface.encodeFunctionData("setFeeTo", [_feeTo]);
215
+ return { to: this.address, data, ...(overrides || {}) };
216
+ },
217
+ setFeeToSetter: async (_feeToSetter, overrides) => {
218
+ const data = this.interface.encodeFunctionData("setFeeToSetter", [_feeToSetter]);
219
+ return { to: this.address, data, ...(overrides || {}) };
220
+ },
221
+ };
222
+ }
223
+
224
+ /**
225
+ * INIT_CODE_HASH
226
+ * @returns {Promise<import("quantumcoin/types").Bytes32>}
227
+ */
228
+ async INIT_CODE_HASH() {
229
+ const res = await this.call("INIT_CODE_HASH", []);
230
+ return Array.isArray(res) ? res[0] : res;
231
+ }
232
+
233
+ /**
234
+ * allPairs
235
+ * @param {import("quantumcoin/types").Uint256Like} arg
236
+ * @returns {Promise<import("quantumcoin/types").SolAddress>}
237
+ */
238
+ async allPairs(arg0) {
239
+ const res = await this.call("allPairs", [arg0]);
240
+ return Array.isArray(res) ? res[0] : res;
241
+ }
242
+
243
+ /**
244
+ * allPairsLength
245
+ * @returns {Promise<import("quantumcoin/types").Uint256>}
246
+ */
247
+ async allPairsLength() {
248
+ const res = await this.call("allPairsLength", []);
249
+ return Array.isArray(res) ? res[0] : res;
250
+ }
251
+
252
+ /**
253
+ * createPair
254
+ * @param {import("quantumcoin/types").AddressLike} tokenA
255
+ * @param {import("quantumcoin/types").AddressLike} tokenB
256
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
257
+ */
258
+ async createPair(tokenA, tokenB, overrides) {
259
+ return this.send("createPair", [tokenA, tokenB], overrides);
260
+ }
261
+
262
+ /**
263
+ * feeTo
264
+ * @returns {Promise<import("quantumcoin/types").SolAddress>}
265
+ */
266
+ async feeTo() {
267
+ const res = await this.call("feeTo", []);
268
+ return Array.isArray(res) ? res[0] : res;
269
+ }
270
+
271
+ /**
272
+ * feeToSetter
273
+ * @returns {Promise<import("quantumcoin/types").SolAddress>}
274
+ */
275
+ async feeToSetter() {
276
+ const res = await this.call("feeToSetter", []);
277
+ return Array.isArray(res) ? res[0] : res;
278
+ }
279
+
280
+ /**
281
+ * getPair
282
+ * @param {import("quantumcoin/types").AddressLike} arg
283
+ * @param {import("quantumcoin/types").AddressLike} arg
284
+ * @returns {Promise<import("quantumcoin/types").SolAddress>}
285
+ */
286
+ async getPair(arg0, arg1) {
287
+ const res = await this.call("getPair", [arg0, arg1]);
288
+ return Array.isArray(res) ? res[0] : res;
289
+ }
290
+
291
+ /**
292
+ * setFeeTo
293
+ * @param {import("quantumcoin/types").AddressLike} _feeTo
294
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
295
+ */
296
+ async setFeeTo(_feeTo, overrides) {
297
+ return this.send("setFeeTo", [_feeTo], overrides);
298
+ }
299
+
300
+ /**
301
+ * setFeeToSetter
302
+ * @param {import("quantumcoin/types").AddressLike} _feeToSetter
303
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
304
+ */
305
+ async setFeeToSetter(_feeToSetter, overrides) {
306
+ return this.send("setFeeToSetter", [_feeToSetter], overrides);
307
+ }
308
+ }
309
+
310
+ module.exports = { QuantumSwapV2Factory };
@@ -0,0 +1,10 @@
1
+ // Auto-generated by sdkgen
2
+ import { ContractFactory, ContractRunner } from "quantumcoin";
3
+ import { QuantumSwapV2Factory } from "./QuantumSwapV2Factory";
4
+ import type * as Types from "./types";
5
+
6
+ export declare class QuantumSwapV2Factory__factory extends ContractFactory {
7
+ constructor(runner: ContractRunner);
8
+ deploy(_feeToSetter: Types.AddressLike, overrides?: any): Promise<QuantumSwapV2Factory>;
9
+ static connect(address: string, runner?: ContractRunner): QuantumSwapV2Factory;
10
+ }
@@ -0,0 +1,29 @@
1
+ // Auto-generated by sdkgen
2
+ const { ContractFactory, getCreateAddress } = require("quantumcoin");
3
+ const { QuantumSwapV2Factory } = require("./QuantumSwapV2Factory");
4
+
5
+ class QuantumSwapV2Factory__factory extends ContractFactory {
6
+ constructor(runner) {
7
+ super(QuantumSwapV2Factory.abi, QuantumSwapV2Factory.bytecode, runner);
8
+ }
9
+
10
+ async deploy(_feeToSetter, overrides) {
11
+ const signer = this.signer;
12
+ if (!signer) { throw new Error("missing signer"); }
13
+ const from = signer.getAddress ? await signer.getAddress() : signer.address;
14
+ const provider = signer.provider;
15
+ if (!provider || !provider.getTransactionCount) { throw new Error("missing provider"); }
16
+ let nonce;
17
+ try { nonce = await provider.getTransactionCount(from, "pending"); } catch { nonce = await provider.getTransactionCount(from, "latest"); }
18
+ const address = getCreateAddress({ from, nonce });
19
+ const txReq = this.getDeployTransaction(_feeToSetter);
20
+ const tx = await signer.sendTransaction({ ...txReq, ...(overrides || {}), nonce });
21
+ return new QuantumSwapV2Factory(address, signer, tx);
22
+ }
23
+
24
+ static connect(address, runner) {
25
+ return QuantumSwapV2Factory.connect(address, runner);
26
+ }
27
+ }
28
+
29
+ module.exports = { QuantumSwapV2Factory__factory };
@@ -0,0 +1,44 @@
1
+ // Auto-generated by sdkgen
2
+ import { Contract, ContractRunner, ContractTransactionResponse, TransactionResponse } from "quantumcoin";
3
+ import type * as Types from "./types";
4
+
5
+ export declare class QuantumSwapV2Pair extends Contract {
6
+ static readonly abi: readonly any[];
7
+ static readonly bytecode: string;
8
+ static connect(address: string, runner?: ContractRunner): QuantumSwapV2Pair;
9
+ constructor(address: string, runner?: ContractRunner, _deployTx?: TransactionResponse);
10
+ readonly populateTransaction: {
11
+ approve(spender: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
12
+ burn(to: Types.AddressLike, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
13
+ initialize(_token0: Types.AddressLike, _token1: Types.AddressLike, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
14
+ mint(to: Types.AddressLike, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
15
+ skim(to: Types.AddressLike, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
16
+ swap(amount0Out: Types.Uint256Like, amount1Out: Types.Uint256Like, to: Types.AddressLike, data: Types.BytesLike, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
17
+ sync(overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
18
+ transfer(to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
19
+ transferFrom(from: Types.AddressLike, to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<import("quantumcoin").TransactionRequest>;
20
+ };
21
+ MINIMUM_LIQUIDITY(): Promise<Types.Uint256>;
22
+ allowance(arg0: Types.AddressLike, arg1: Types.AddressLike): Promise<Types.Uint256>;
23
+ approve(spender: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<ContractTransactionResponse>;
24
+ balanceOf(arg0: Types.AddressLike): Promise<Types.Uint256>;
25
+ burn(to: Types.AddressLike, overrides?: any): Promise<ContractTransactionResponse>;
26
+ decimals(): Promise<Types.Uint8>;
27
+ factory(): Promise<Types.SolAddress>;
28
+ getReserves(): Promise<[Types.Uint112, Types.Uint112, Types.Uint32]>;
29
+ initialize(_token0: Types.AddressLike, _token1: Types.AddressLike, overrides?: any): Promise<ContractTransactionResponse>;
30
+ kLast(): Promise<Types.Uint256>;
31
+ mint(to: Types.AddressLike, overrides?: any): Promise<ContractTransactionResponse>;
32
+ name(): Promise<string>;
33
+ price0CumulativeLast(): Promise<Types.Uint256>;
34
+ price1CumulativeLast(): Promise<Types.Uint256>;
35
+ skim(to: Types.AddressLike, overrides?: any): Promise<ContractTransactionResponse>;
36
+ swap(amount0Out: Types.Uint256Like, amount1Out: Types.Uint256Like, to: Types.AddressLike, data: Types.BytesLike, overrides?: any): Promise<ContractTransactionResponse>;
37
+ symbol(): Promise<string>;
38
+ sync(overrides?: any): Promise<ContractTransactionResponse>;
39
+ token0(): Promise<Types.SolAddress>;
40
+ token1(): Promise<Types.SolAddress>;
41
+ totalSupply(): Promise<Types.Uint256>;
42
+ transfer(to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<ContractTransactionResponse>;
43
+ transferFrom(from: Types.AddressLike, to: Types.AddressLike, value: Types.Uint256Like, overrides?: any): Promise<ContractTransactionResponse>;
44
+ }