@alephium/powfi-sdk 0.0.1-rc.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.
- package/README.md +4 -0
- package/clmm/artifacts/BitmapWord.ral.json +125 -0
- package/clmm/artifacts/BitmapWordDeployer.ral.json +31 -0
- package/clmm/artifacts/CreateConfig.ral.json +37 -0
- package/clmm/artifacts/CreateLiquidPool.ral.json +55 -0
- package/clmm/artifacts/DexAccount.ral.json +110 -0
- package/clmm/artifacts/LiquidityAmountsTest.ral.json +161 -0
- package/clmm/artifacts/LiquidityManagmentTest.ral.json +384 -0
- package/clmm/artifacts/Pool.ral.json +1530 -0
- package/clmm/artifacts/PoolConfig.ral.json +31 -0
- package/clmm/artifacts/PoolFactory.ral.json +300 -0
- package/clmm/artifacts/PoolRouterDemo.ral.json +49 -0
- package/clmm/artifacts/PoolUser.ral.json +89 -0
- package/clmm/artifacts/Position.ral.json +183 -0
- package/clmm/artifacts/PositionManager.ral.json +416 -0
- package/clmm/artifacts/SwapWithoutAccount.ral.json +46 -0
- package/clmm/artifacts/TestToken.ral.json +68 -0
- package/clmm/artifacts/Tick.ral.json +161 -0
- package/clmm/artifacts/TickBitmapTest.ral.json +220 -0
- package/clmm/artifacts/constants.ral.json +81 -0
- package/clmm/artifacts/structs.ral.json +335 -0
- package/clmm/artifacts/ts/BitmapWord.ts +337 -0
- package/clmm/artifacts/ts/BitmapWordDeployer.ts +164 -0
- package/clmm/artifacts/ts/DexAccount.ts +330 -0
- package/clmm/artifacts/ts/LiquidityAmountsTest.ts +464 -0
- package/clmm/artifacts/ts/LiquidityManagmentTest.ts +859 -0
- package/clmm/artifacts/ts/Pool.ts +2535 -0
- package/clmm/artifacts/ts/PoolConfig.ts +179 -0
- package/clmm/artifacts/ts/PoolFactory.ts +640 -0
- package/clmm/artifacts/ts/PoolUser.ts +237 -0
- package/clmm/artifacts/ts/Position.ts +440 -0
- package/clmm/artifacts/ts/PositionManager.ts +929 -0
- package/clmm/artifacts/ts/TestToken.ts +277 -0
- package/clmm/artifacts/ts/Tick.ts +351 -0
- package/clmm/artifacts/ts/TickBitmapTest.ts +512 -0
- package/clmm/artifacts/ts/constants.ts +17 -0
- package/clmm/artifacts/ts/contracts.ts +26 -0
- package/clmm/artifacts/ts/deployments.ts +160 -0
- package/clmm/artifacts/ts/index.ts +20 -0
- package/clmm/artifacts/ts/scripts.ts +76 -0
- package/clmm/artifacts/ts/types.ts +105 -0
- package/clmm/deployments/.deployments.devnet.json +350 -0
- package/clmm/deployments/.deployments.testnet.json +350 -0
- package/cpmm/artifacts/dex/DexAccount.ral.json +110 -0
- package/cpmm/artifacts/dex/Router.ral.json +361 -0
- package/cpmm/artifacts/dex/TokenPair.ral.json +512 -0
- package/cpmm/artifacts/dex/TokenPairFactory.ral.json +297 -0
- package/cpmm/artifacts/examples/ExampleOracleSimple.ral.json +192 -0
- package/cpmm/artifacts/examples/FeeCollectorFactoryImpl.ral.json +185 -0
- package/cpmm/artifacts/examples/FeeCollectorPerTokenPairImpl.ral.json +216 -0
- package/cpmm/artifacts/examples/FullMathTest.ral.json +123 -0
- package/cpmm/artifacts/scripts/AddLiquidity.ral.json +46 -0
- package/cpmm/artifacts/scripts/Burn.ral.json +31 -0
- package/cpmm/artifacts/scripts/CollectFee.ral.json +25 -0
- package/cpmm/artifacts/scripts/CreatePair.ral.json +37 -0
- package/cpmm/artifacts/scripts/CreatePairAndAddLiquidity.ral.json +43 -0
- package/cpmm/artifacts/scripts/EnableFeeCollector.ral.json +28 -0
- package/cpmm/artifacts/scripts/Mint.ral.json +34 -0
- package/cpmm/artifacts/scripts/RemoveLiquidity.ral.json +43 -0
- package/cpmm/artifacts/scripts/SetFeeCollectorFactory.ral.json +28 -0
- package/cpmm/artifacts/scripts/Swap.ral.json +46 -0
- package/cpmm/artifacts/scripts/SwapMaxIn.ral.json +46 -0
- package/cpmm/artifacts/scripts/SwapMinOut.ral.json +46 -0
- package/cpmm/artifacts/test/GetToken.ral.json +31 -0
- package/cpmm/artifacts/test/MathTest.ral.json +49 -0
- package/cpmm/artifacts/test/TestToken.ral.json +87 -0
- package/cpmm/artifacts/ts/DexAccount.ts +329 -0
- package/cpmm/artifacts/ts/ExampleOracleSimple.ts +383 -0
- package/cpmm/artifacts/ts/FeeCollectorFactoryImpl.ts +227 -0
- package/cpmm/artifacts/ts/FeeCollectorPerTokenPairImpl.ts +327 -0
- package/cpmm/artifacts/ts/FullMathTest.ts +251 -0
- package/cpmm/artifacts/ts/MathTest.ts +183 -0
- package/cpmm/artifacts/ts/Router.ts +554 -0
- package/cpmm/artifacts/ts/TestToken.ts +312 -0
- package/cpmm/artifacts/ts/TokenPair.ts +947 -0
- package/cpmm/artifacts/ts/TokenPairFactory.ts +501 -0
- package/cpmm/artifacts/ts/contracts.ts +26 -0
- package/cpmm/artifacts/ts/deployments.ts +109 -0
- package/cpmm/artifacts/ts/index.ts +16 -0
- package/cpmm/artifacts/ts/scripts.ts +142 -0
- package/cpmm/deployments/.deployments.devnet.json +77 -0
- package/cpmm/deployments/.deployments.testnet.json +79 -0
- package/lib/index.d.mts +8800 -0
- package/lib/index.d.ts +8800 -0
- package/lib/index.js +21769 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +22118 -0
- package/lib/index.mjs.map +1 -0
- package/package.json +80 -0
- package/src/clmm/clmm.ts +607 -0
- package/src/clmm/constants.ts +7 -0
- package/src/clmm/index.ts +6 -0
- package/src/clmm/liquidity.ts +163 -0
- package/src/clmm/pool.ts +154 -0
- package/src/clmm/tick.ts +335 -0
- package/src/clmm/types.ts +155 -0
- package/src/common/constants.ts +1 -0
- package/src/common/error.ts +46 -0
- package/src/common/index.ts +7 -0
- package/src/common/logger.ts +82 -0
- package/src/common/math.ts +88 -0
- package/src/common/numeric.ts +64 -0
- package/src/common/types.ts +49 -0
- package/src/common/utils.ts +3 -0
- package/src/cpmm/constants.ts +2 -0
- package/src/cpmm/cpmm.ts +631 -0
- package/src/cpmm/index.ts +3 -0
- package/src/cpmm/types.ts +113 -0
- package/src/index.ts +25 -0
- package/src/moduleBase.ts +64 -0
- package/src/staking/index.ts +4 -0
- package/src/staking/settings.ts +38 -0
- package/src/staking/staking.ts +277 -0
- package/src/staking/types.ts +15 -0
- package/src/staking/utils.ts +25 -0
- package/src/token/index.ts +1 -0
- package/src/token/token.ts +163 -0
- package/src/zeta.ts +105 -0
- package/staking/artifacts/AlphStakeAndLock.ral.json +31 -0
- package/staking/artifacts/AlphUnstakeVault.ral.json +151 -0
- package/staking/artifacts/XAlphStakeVault.ral.json +559 -0
- package/staking/artifacts/XAlphToken.ral.json +404 -0
- package/staking/artifacts/XAlphUnlockAndStartUnstake.ral.json +31 -0
- package/staking/artifacts/examples/GovernanceDemo.ral.json +282 -0
- package/staking/artifacts/examples/RewardSharingVault.ral.json +253 -0
- package/staking/artifacts/structs.ral.json +47 -0
- package/staking/artifacts/ts/AlphUnstakeVault.ts +354 -0
- package/staking/artifacts/ts/FullMathTest.ts +175 -0
- package/staking/artifacts/ts/GovernanceDemo.ts +726 -0
- package/staking/artifacts/ts/RewardSharingVault.ts +559 -0
- package/staking/artifacts/ts/TestDynamicArrayByteVec32.ts +431 -0
- package/staking/artifacts/ts/TestDynamicSortedArrayForU256.ts +516 -0
- package/staking/artifacts/ts/TestMerkleProof.ts +343 -0
- package/staking/artifacts/ts/XAlphStakeVault.ts +1120 -0
- package/staking/artifacts/ts/XAlphToken.ts +835 -0
- package/staking/artifacts/ts/contracts.ts +26 -0
- package/staking/artifacts/ts/deployments.ts +109 -0
- package/staking/artifacts/ts/index.ts +15 -0
- package/staking/artifacts/ts/scripts.ts +35 -0
- package/staking/artifacts/ts/types.ts +19 -0
- package/staking/artifacts/utils/FullMathTest.ral.json +57 -0
- package/staking/artifacts/utils/TestDynamicArrayByteVec32.ral.json +165 -0
- package/staking/artifacts/utils/TestDynamicSortedArrayForU256.ral.json +189 -0
- package/staking/artifacts/utils/TestMerkleProof.ral.json +134 -0
- package/staking/deployments/.deployments.devnet.json +77 -0
- package/staking/deployments/.deployments.testnet.json +78 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import { Contract, ContractFactory } from "@alephium/web3";
|
|
6
|
+
|
|
7
|
+
let contracts: ContractFactory<any>[] | undefined = undefined;
|
|
8
|
+
|
|
9
|
+
export function getAllContracts(): ContractFactory<any>[] {
|
|
10
|
+
return contracts ?? [];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function registerContract(factory: ContractFactory<any>) {
|
|
14
|
+
if (contracts === undefined) {
|
|
15
|
+
contracts = [factory];
|
|
16
|
+
} else {
|
|
17
|
+
contracts.push(factory);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function getContractByCodeHash(codeHash: string): Contract {
|
|
21
|
+
const c = contracts?.find((c) => c.contract.hasCodeHash(codeHash));
|
|
22
|
+
if (c === undefined) {
|
|
23
|
+
throw new Error("Unknown code with code hash: " + codeHash);
|
|
24
|
+
}
|
|
25
|
+
return c.contract;
|
|
26
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
RunScriptResult,
|
|
7
|
+
DeployContractExecutionResult,
|
|
8
|
+
NetworkId,
|
|
9
|
+
} from "@alephium/web3";
|
|
10
|
+
import {
|
|
11
|
+
AlphUnstakeVault,
|
|
12
|
+
AlphUnstakeVaultInstance,
|
|
13
|
+
XAlphToken,
|
|
14
|
+
XAlphTokenInstance,
|
|
15
|
+
GovernanceDemo,
|
|
16
|
+
GovernanceDemoInstance,
|
|
17
|
+
RewardSharingVault,
|
|
18
|
+
RewardSharingVaultInstance,
|
|
19
|
+
XAlphStakeVault,
|
|
20
|
+
XAlphStakeVaultInstance,
|
|
21
|
+
} from ".";
|
|
22
|
+
import { default as testnetDeployments } from "../../deployments/.deployments.testnet.json";
|
|
23
|
+
import { default as devnetDeployments } from "../../deployments/.deployments.devnet.json";
|
|
24
|
+
|
|
25
|
+
export type Deployments = {
|
|
26
|
+
deployerAddress: string;
|
|
27
|
+
contracts: {
|
|
28
|
+
AlphUnstakeVault: DeployContractExecutionResult<AlphUnstakeVaultInstance>;
|
|
29
|
+
XAlphToken: DeployContractExecutionResult<XAlphTokenInstance>;
|
|
30
|
+
GovernanceDemo: DeployContractExecutionResult<GovernanceDemoInstance>;
|
|
31
|
+
RewardSharingVault: DeployContractExecutionResult<RewardSharingVaultInstance>;
|
|
32
|
+
XAlphStakeVault: DeployContractExecutionResult<XAlphStakeVaultInstance>;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
function toDeployments(json: any): Deployments {
|
|
37
|
+
const contracts = {
|
|
38
|
+
AlphUnstakeVault: {
|
|
39
|
+
...json.contracts["AlphUnstakeVault"],
|
|
40
|
+
contractInstance: AlphUnstakeVault.at(
|
|
41
|
+
json.contracts["AlphUnstakeVault"].contractInstance.address
|
|
42
|
+
),
|
|
43
|
+
},
|
|
44
|
+
XAlphToken: {
|
|
45
|
+
...json.contracts["XAlphToken"],
|
|
46
|
+
contractInstance: XAlphToken.at(
|
|
47
|
+
json.contracts["XAlphToken"].contractInstance.address
|
|
48
|
+
),
|
|
49
|
+
},
|
|
50
|
+
GovernanceDemo: {
|
|
51
|
+
...json.contracts["GovernanceDemo"],
|
|
52
|
+
contractInstance: GovernanceDemo.at(
|
|
53
|
+
json.contracts["GovernanceDemo"].contractInstance.address
|
|
54
|
+
),
|
|
55
|
+
},
|
|
56
|
+
RewardSharingVault: {
|
|
57
|
+
...json.contracts["RewardSharingVault"],
|
|
58
|
+
contractInstance: RewardSharingVault.at(
|
|
59
|
+
json.contracts["RewardSharingVault"].contractInstance.address
|
|
60
|
+
),
|
|
61
|
+
},
|
|
62
|
+
XAlphStakeVault: {
|
|
63
|
+
...json.contracts["XAlphStakeVault"],
|
|
64
|
+
contractInstance: XAlphStakeVault.at(
|
|
65
|
+
json.contracts["XAlphStakeVault"].contractInstance.address
|
|
66
|
+
),
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
...json,
|
|
71
|
+
contracts: contracts as Deployments["contracts"],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function loadDeployments(
|
|
76
|
+
networkId: NetworkId,
|
|
77
|
+
deployerAddress?: string
|
|
78
|
+
): Deployments {
|
|
79
|
+
const deployments =
|
|
80
|
+
networkId === "testnet"
|
|
81
|
+
? testnetDeployments
|
|
82
|
+
: networkId === "devnet"
|
|
83
|
+
? devnetDeployments
|
|
84
|
+
: undefined;
|
|
85
|
+
if (deployments === undefined) {
|
|
86
|
+
throw Error("The contract has not been deployed to the " + networkId);
|
|
87
|
+
}
|
|
88
|
+
const allDeployments: any[] = Array.isArray(deployments)
|
|
89
|
+
? deployments
|
|
90
|
+
: [deployments];
|
|
91
|
+
if (deployerAddress === undefined) {
|
|
92
|
+
if (allDeployments.length > 1) {
|
|
93
|
+
throw Error(
|
|
94
|
+
"The contract has been deployed multiple times on " +
|
|
95
|
+
networkId +
|
|
96
|
+
", please specify the deployer address"
|
|
97
|
+
);
|
|
98
|
+
} else {
|
|
99
|
+
return toDeployments(allDeployments[0]);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const result = allDeployments.find(
|
|
103
|
+
(d) => d.deployerAddress === deployerAddress
|
|
104
|
+
);
|
|
105
|
+
if (result === undefined) {
|
|
106
|
+
throw Error("The contract deployment result does not exist");
|
|
107
|
+
}
|
|
108
|
+
return toDeployments(result);
|
|
109
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
export * from "./AlphUnstakeVault";
|
|
6
|
+
export * from "./FullMathTest";
|
|
7
|
+
export * from "./GovernanceDemo";
|
|
8
|
+
export * from "./RewardSharingVault";
|
|
9
|
+
export * from "./TestDynamicArrayByteVec32";
|
|
10
|
+
export * from "./TestDynamicSortedArrayForU256";
|
|
11
|
+
export * from "./TestMerkleProof";
|
|
12
|
+
export * from "./XAlphStakeVault";
|
|
13
|
+
export * from "./XAlphToken";
|
|
14
|
+
export * from "./contracts";
|
|
15
|
+
export * from "./scripts";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Address,
|
|
7
|
+
ExecutableScript,
|
|
8
|
+
ExecuteScriptParams,
|
|
9
|
+
ExecuteScriptResult,
|
|
10
|
+
Script,
|
|
11
|
+
SignerProvider,
|
|
12
|
+
HexString,
|
|
13
|
+
} from "@alephium/web3";
|
|
14
|
+
import { getContractByCodeHash } from "./contracts";
|
|
15
|
+
import { default as AlphStakeAndLockScriptJson } from "../AlphStakeAndLock.ral.json";
|
|
16
|
+
import { default as XAlphUnlockAndStartUnstakeScriptJson } from "../XAlphUnlockAndStartUnstake.ral.json";
|
|
17
|
+
import * as types from "./types";
|
|
18
|
+
|
|
19
|
+
export const AlphStakeAndLock = new ExecutableScript<{
|
|
20
|
+
xAlphToken: HexString;
|
|
21
|
+
xAlphStakeVault: HexString;
|
|
22
|
+
amount: bigint;
|
|
23
|
+
}>(
|
|
24
|
+
Script.fromJson(AlphStakeAndLockScriptJson, "", types.AllStructs),
|
|
25
|
+
getContractByCodeHash
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const XAlphUnlockAndStartUnstake = new ExecutableScript<{
|
|
29
|
+
xAlphToken: HexString;
|
|
30
|
+
xAlphStakeVault: HexString;
|
|
31
|
+
amount: bigint;
|
|
32
|
+
}>(
|
|
33
|
+
Script.fromJson(XAlphUnlockAndStartUnstakeScriptJson, "", types.AllStructs),
|
|
34
|
+
getContractByCodeHash
|
|
35
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import { Address, HexString, Val, Struct } from "@alephium/web3";
|
|
6
|
+
import { default as allStructsJson } from "../structs.ral.json";
|
|
7
|
+
export const AllStructs = allStructsJson.map((json) => Struct.fromJson(json));
|
|
8
|
+
export interface UserRewardSharingInfo extends Record<string, Val> {
|
|
9
|
+
amount: bigint;
|
|
10
|
+
rewardPerToken: bigint;
|
|
11
|
+
}
|
|
12
|
+
export interface UserStakingInfo extends Record<string, Val> {
|
|
13
|
+
amount: bigint;
|
|
14
|
+
connectedDapps: HexString;
|
|
15
|
+
}
|
|
16
|
+
export interface VoteInfo extends Record<string, Val> {
|
|
17
|
+
proposalVoted: bigint;
|
|
18
|
+
amount: bigint;
|
|
19
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "v4.2.5",
|
|
3
|
+
"name": "FullMathTest",
|
|
4
|
+
"bytecode": "000140ea0000030901409216020c3013415e7b160016010c0d3687170316001601371704160316043616031604314c020d4a010c36170516050c2f4c04160416022d02160216053313415f7b160016011602871706160516061604334c020d4a010c361705160416063617040c1602361602381707160216072d1702160416072d17040c16073616072d0d351707160416051607373917040f1602370e3a170816080e16021608373637170816080e16021608373637170816080e16021608373637170816080e16021608373637170816080e16021608373637170816080e160216083736371708160416083702",
|
|
5
|
+
"codeHash": "fd74df789eb5974e11dfa74960ba1323e0530fe5e1fe0aa43a6c3c9bf9ee1d98",
|
|
6
|
+
"fieldsSig": {
|
|
7
|
+
"names": [],
|
|
8
|
+
"types": [],
|
|
9
|
+
"isMutable": []
|
|
10
|
+
},
|
|
11
|
+
"eventsSig": [],
|
|
12
|
+
"functions": [
|
|
13
|
+
{
|
|
14
|
+
"name": "mulDiv",
|
|
15
|
+
"paramNames": [
|
|
16
|
+
"a",
|
|
17
|
+
"b",
|
|
18
|
+
"denominator"
|
|
19
|
+
],
|
|
20
|
+
"paramTypes": [
|
|
21
|
+
"U256",
|
|
22
|
+
"U256",
|
|
23
|
+
"U256"
|
|
24
|
+
],
|
|
25
|
+
"paramIsMutable": [
|
|
26
|
+
false,
|
|
27
|
+
false,
|
|
28
|
+
true
|
|
29
|
+
],
|
|
30
|
+
"returnTypes": [
|
|
31
|
+
"U256"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"constants": [],
|
|
36
|
+
"enums": [
|
|
37
|
+
{
|
|
38
|
+
"name": "FullMathError",
|
|
39
|
+
"fields": [
|
|
40
|
+
{
|
|
41
|
+
"name": "DivByZero",
|
|
42
|
+
"value": {
|
|
43
|
+
"type": "U256",
|
|
44
|
+
"value": "350"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "MulDivOverflow",
|
|
49
|
+
"value": {
|
|
50
|
+
"type": "U256",
|
|
51
|
+
"value": "351"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "v4.2.5",
|
|
3
|
+
"name": "TestDynamicArrayByteVec32",
|
|
4
|
+
"bytecode": "00074028407340af40cc40fc411a4128010002030112d3545eacd4160116000005311342277b160113202c170216001602160213202a620201000204014028d3083a358916004313202e0c2f1342267b16014313202f1342287b1600000517020c170316031602314c0e1600160300001601414c0316033f0216030d2a17034a2e0b0201000203011fd3694941c216004313202e0c2f1342267b16014313202f1342287b160016010001170216020b244c031600024a05160016023d00040201000202010dd354ad273416004313202e0c2f1342267b160016014402010002030118d34b2e25b7160116000005311342277b160113202c170216000c1602621600160213202a16004362440201000101010ed30041471116004313202e0c2f1342267b16004313202d02010000000103d3676c3c33140002",
|
|
5
|
+
"codeHash": "594861ab1850f3d1872ee687c87ddfeca8746bfe5b9ade07fabc4ca27c56661c",
|
|
6
|
+
"fieldsSig": {
|
|
7
|
+
"names": [],
|
|
8
|
+
"types": [],
|
|
9
|
+
"isMutable": []
|
|
10
|
+
},
|
|
11
|
+
"eventsSig": [],
|
|
12
|
+
"functions": [
|
|
13
|
+
{
|
|
14
|
+
"name": "get",
|
|
15
|
+
"paramNames": [
|
|
16
|
+
"array",
|
|
17
|
+
"index"
|
|
18
|
+
],
|
|
19
|
+
"paramTypes": [
|
|
20
|
+
"ByteVec",
|
|
21
|
+
"U256"
|
|
22
|
+
],
|
|
23
|
+
"paramIsMutable": [
|
|
24
|
+
false,
|
|
25
|
+
false
|
|
26
|
+
],
|
|
27
|
+
"returnTypes": [
|
|
28
|
+
"ByteVec"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "find",
|
|
33
|
+
"paramNames": [
|
|
34
|
+
"array",
|
|
35
|
+
"value"
|
|
36
|
+
],
|
|
37
|
+
"paramTypes": [
|
|
38
|
+
"ByteVec",
|
|
39
|
+
"ByteVec"
|
|
40
|
+
],
|
|
41
|
+
"paramIsMutable": [
|
|
42
|
+
false,
|
|
43
|
+
false
|
|
44
|
+
],
|
|
45
|
+
"returnTypes": [
|
|
46
|
+
"I256"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "remove",
|
|
51
|
+
"paramNames": [
|
|
52
|
+
"array",
|
|
53
|
+
"value"
|
|
54
|
+
],
|
|
55
|
+
"paramTypes": [
|
|
56
|
+
"ByteVec",
|
|
57
|
+
"ByteVec"
|
|
58
|
+
],
|
|
59
|
+
"paramIsMutable": [
|
|
60
|
+
false,
|
|
61
|
+
false
|
|
62
|
+
],
|
|
63
|
+
"returnTypes": [
|
|
64
|
+
"ByteVec"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "push",
|
|
69
|
+
"paramNames": [
|
|
70
|
+
"array",
|
|
71
|
+
"value"
|
|
72
|
+
],
|
|
73
|
+
"paramTypes": [
|
|
74
|
+
"ByteVec",
|
|
75
|
+
"ByteVec"
|
|
76
|
+
],
|
|
77
|
+
"paramIsMutable": [
|
|
78
|
+
false,
|
|
79
|
+
false
|
|
80
|
+
],
|
|
81
|
+
"returnTypes": [
|
|
82
|
+
"ByteVec"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "removeAt",
|
|
87
|
+
"paramNames": [
|
|
88
|
+
"array",
|
|
89
|
+
"index"
|
|
90
|
+
],
|
|
91
|
+
"paramTypes": [
|
|
92
|
+
"ByteVec",
|
|
93
|
+
"U256"
|
|
94
|
+
],
|
|
95
|
+
"paramIsMutable": [
|
|
96
|
+
false,
|
|
97
|
+
false
|
|
98
|
+
],
|
|
99
|
+
"returnTypes": [
|
|
100
|
+
"ByteVec"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "size",
|
|
105
|
+
"paramNames": [
|
|
106
|
+
"array"
|
|
107
|
+
],
|
|
108
|
+
"paramTypes": [
|
|
109
|
+
"ByteVec"
|
|
110
|
+
],
|
|
111
|
+
"paramIsMutable": [
|
|
112
|
+
false
|
|
113
|
+
],
|
|
114
|
+
"returnTypes": [
|
|
115
|
+
"U256"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "empty",
|
|
120
|
+
"paramNames": [],
|
|
121
|
+
"paramTypes": [],
|
|
122
|
+
"paramIsMutable": [],
|
|
123
|
+
"returnTypes": [
|
|
124
|
+
"ByteVec"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"constants": [
|
|
129
|
+
{
|
|
130
|
+
"name": "IntByteLength",
|
|
131
|
+
"value": {
|
|
132
|
+
"type": "U256",
|
|
133
|
+
"value": "32"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"enums": [
|
|
138
|
+
{
|
|
139
|
+
"name": "ErrorCode",
|
|
140
|
+
"fields": [
|
|
141
|
+
{
|
|
142
|
+
"name": "InvalidArrayLength",
|
|
143
|
+
"value": {
|
|
144
|
+
"type": "U256",
|
|
145
|
+
"value": "550"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "IndexOutOfBound",
|
|
150
|
+
"value": {
|
|
151
|
+
"type": "U256",
|
|
152
|
+
"value": "551"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "InvalidByteVecLength",
|
|
157
|
+
"value": {
|
|
158
|
+
"type": "U256",
|
|
159
|
+
"value": "552"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "v4.2.5",
|
|
3
|
+
"name": "TestDynamicSortedArrayForU256",
|
|
4
|
+
"bytecode": "0008402d4056408840a640f341234141414f010002040115d3cee93194160116000006311342277b160113202c170216001602160213202a62170316037102010002030114d33cd5e72916004313202e0c2f1342267b16004313202d1702160016010c1602000402010002030119d32cabd28216004313202e0c2f1342267b160016010001170216020b244c031600024a05160016023d00050201000202010ed31bc25d3416004313202e0c2f1342267b160016016b44020000040601402a16021603344c020b02160216032a0e2d17041600160400001705160516012f4c0316043f0216051601314c091600160116040d2a16030004024a061600160116021604000402010002030118d34b2e25b7160116000006311342277b160113202c170216000c1602621600160213202a16004362440201000101010ed30041471116004313202e0c2f1342267b16004313202d02010000000103d3676c3c33140002",
|
|
5
|
+
"codeHash": "86f2584a16af632c63b6c1ead625d4d53f11b9a3f2d465010085bd740be281d3",
|
|
6
|
+
"fieldsSig": {
|
|
7
|
+
"names": [],
|
|
8
|
+
"types": [],
|
|
9
|
+
"isMutable": []
|
|
10
|
+
},
|
|
11
|
+
"eventsSig": [],
|
|
12
|
+
"functions": [
|
|
13
|
+
{
|
|
14
|
+
"name": "get",
|
|
15
|
+
"paramNames": [
|
|
16
|
+
"array",
|
|
17
|
+
"index"
|
|
18
|
+
],
|
|
19
|
+
"paramTypes": [
|
|
20
|
+
"ByteVec",
|
|
21
|
+
"U256"
|
|
22
|
+
],
|
|
23
|
+
"paramIsMutable": [
|
|
24
|
+
false,
|
|
25
|
+
false
|
|
26
|
+
],
|
|
27
|
+
"returnTypes": [
|
|
28
|
+
"U256"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "find",
|
|
33
|
+
"paramNames": [
|
|
34
|
+
"array",
|
|
35
|
+
"value"
|
|
36
|
+
],
|
|
37
|
+
"paramTypes": [
|
|
38
|
+
"ByteVec",
|
|
39
|
+
"U256"
|
|
40
|
+
],
|
|
41
|
+
"paramIsMutable": [
|
|
42
|
+
false,
|
|
43
|
+
false
|
|
44
|
+
],
|
|
45
|
+
"returnTypes": [
|
|
46
|
+
"I256"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "remove",
|
|
51
|
+
"paramNames": [
|
|
52
|
+
"array",
|
|
53
|
+
"value"
|
|
54
|
+
],
|
|
55
|
+
"paramTypes": [
|
|
56
|
+
"ByteVec",
|
|
57
|
+
"U256"
|
|
58
|
+
],
|
|
59
|
+
"paramIsMutable": [
|
|
60
|
+
false,
|
|
61
|
+
false
|
|
62
|
+
],
|
|
63
|
+
"returnTypes": [
|
|
64
|
+
"ByteVec"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "push",
|
|
69
|
+
"paramNames": [
|
|
70
|
+
"array",
|
|
71
|
+
"value"
|
|
72
|
+
],
|
|
73
|
+
"paramTypes": [
|
|
74
|
+
"ByteVec",
|
|
75
|
+
"U256"
|
|
76
|
+
],
|
|
77
|
+
"paramIsMutable": [
|
|
78
|
+
false,
|
|
79
|
+
false
|
|
80
|
+
],
|
|
81
|
+
"returnTypes": [
|
|
82
|
+
"ByteVec"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "binarySearch",
|
|
87
|
+
"paramNames": [
|
|
88
|
+
"array",
|
|
89
|
+
"value",
|
|
90
|
+
"left",
|
|
91
|
+
"right"
|
|
92
|
+
],
|
|
93
|
+
"paramTypes": [
|
|
94
|
+
"ByteVec",
|
|
95
|
+
"U256",
|
|
96
|
+
"U256",
|
|
97
|
+
"U256"
|
|
98
|
+
],
|
|
99
|
+
"paramIsMutable": [
|
|
100
|
+
false,
|
|
101
|
+
false,
|
|
102
|
+
false,
|
|
103
|
+
false
|
|
104
|
+
],
|
|
105
|
+
"returnTypes": [
|
|
106
|
+
"I256"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "removeAt",
|
|
111
|
+
"paramNames": [
|
|
112
|
+
"array",
|
|
113
|
+
"index"
|
|
114
|
+
],
|
|
115
|
+
"paramTypes": [
|
|
116
|
+
"ByteVec",
|
|
117
|
+
"U256"
|
|
118
|
+
],
|
|
119
|
+
"paramIsMutable": [
|
|
120
|
+
false,
|
|
121
|
+
false
|
|
122
|
+
],
|
|
123
|
+
"returnTypes": [
|
|
124
|
+
"ByteVec"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "size",
|
|
129
|
+
"paramNames": [
|
|
130
|
+
"array"
|
|
131
|
+
],
|
|
132
|
+
"paramTypes": [
|
|
133
|
+
"ByteVec"
|
|
134
|
+
],
|
|
135
|
+
"paramIsMutable": [
|
|
136
|
+
false
|
|
137
|
+
],
|
|
138
|
+
"returnTypes": [
|
|
139
|
+
"U256"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "empty",
|
|
144
|
+
"paramNames": [],
|
|
145
|
+
"paramTypes": [],
|
|
146
|
+
"paramIsMutable": [],
|
|
147
|
+
"returnTypes": [
|
|
148
|
+
"ByteVec"
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"constants": [
|
|
153
|
+
{
|
|
154
|
+
"name": "IntByteLength",
|
|
155
|
+
"value": {
|
|
156
|
+
"type": "U256",
|
|
157
|
+
"value": "32"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"enums": [
|
|
162
|
+
{
|
|
163
|
+
"name": "ErrorCode",
|
|
164
|
+
"fields": [
|
|
165
|
+
{
|
|
166
|
+
"name": "InvalidArrayLength",
|
|
167
|
+
"value": {
|
|
168
|
+
"type": "U256",
|
|
169
|
+
"value": "550"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"name": "IndexOutOfBound",
|
|
174
|
+
"value": {
|
|
175
|
+
"type": "U256",
|
|
176
|
+
"value": "551"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "InvalidByteVecLength",
|
|
181
|
+
"value": {
|
|
182
|
+
"type": "U256",
|
|
183
|
+
"value": "552"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|