@agoric/builders 0.2.0-u18.5 → 0.2.0-u18a.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/CHANGELOG.md +43 -0
- package/package.json +30 -28
- package/scripts/fast-usdc/fast-usdc-update.build.js +61 -0
- package/scripts/fast-usdc/init-fast-usdc.js +197 -0
- package/scripts/inter-protocol/replace-feeDistributor.js +28 -0
- package/scripts/orchestration/init-basic-flows.js +42 -2
- package/scripts/testing/add-USD-LEMONS.js +19 -0
- package/scripts/testing/add-USD-OLIVES.js +19 -0
- package/scripts/testing/init-auto-stake-it.js +73 -0
- package/scripts/testing/init-send-anywhere.js +67 -0
- package/scripts/testing/publish-test-info.js +79 -0
- package/scripts/testing/recorded-retired-instances.js +9 -0
- package/scripts/testing/register-interchain-bank-assets.js +199 -0
- package/scripts/testing/replace-feeDistributor-short.js +33 -0
- package/scripts/testing/test-upgraded-board.js +15 -0
- package/scripts/testing/{fix-buggy-sendAnywhere.js → upgrade-send-anywhere.js} +14 -18
- package/scripts/testing/upgrade-vaultFactory.js +21 -0
- package/scripts/vats/terminate-governor-instance.js +134 -0
- package/scripts/vats/upgrade-agoricNames.js +21 -0
- package/scripts/vats/upgrade-asset-reserve.js +21 -0
- package/scripts/vats/upgrade-board.js +20 -0
- package/scripts/vats/upgrade-mintHolder.js +126 -0
- package/scripts/vats/{upgrade-orch-core.js → upgrade-orchestration.js} +5 -2
- package/scripts/vats/upgrade-paRegistry.js +21 -0
- package/scripts/testing/start-auto-stake-it.js +0 -128
- package/scripts/testing/start-buggy-sendAnywhere.js +0 -143
- package/scripts/testing/start-send-anywhere.js +0 -136
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,49 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.2.0-u18a.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/builders@0.2.0-u18.6...@agoric/builders@0.2.0-u18a.0) (2025-02-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @agoric/builders
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.2.0-u18.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/builders@0.2.0-u18.5...@agoric/builders@0.2.0-u18.6) (2024-12-24)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* `ForwardOpts` accepts `intermediateRecipient` ([eb975f1](https://github.com/Agoric/agoric-sdk/commit/eb975f1df1587bc9307b27c20b7b236cc7fe386e))
|
|
20
|
+
* `ForwardOptsShape` ([50b1717](https://github.com/Agoric/agoric-sdk/commit/50b1717c1e40ed67a5e69810961ad8d0144c5f9e))
|
|
21
|
+
* add `bech32Prefix?: string` to `CosmosChainInfo` ([cb9e1ee](https://github.com/Agoric/agoric-sdk/commit/cb9e1eeab9295b44ec009b82d73c457299e8d6f4))
|
|
22
|
+
* advancer with fees ([087f3a8](https://github.com/Agoric/agoric-sdk/commit/087f3a84a266fd0061f6d35c7b51f193de308f95))
|
|
23
|
+
* assetInfo as array of entries ([51e7a9c](https://github.com/Agoric/agoric-sdk/commit/51e7a9c3e3fb2cde44db2ffce817f353a17e76a3))
|
|
24
|
+
* **builders:** --noNoble option for init-fast-usdc ([508a3e0](https://github.com/Agoric/agoric-sdk/commit/508a3e0876d0fadac0e4a2fc1fa64b86ff8e5c2d))
|
|
25
|
+
* **builders:** fast-usdc builder w/CLI config ([9f45a05](https://github.com/Agoric/agoric-sdk/commit/9f45a0572777cfe26012b5f48ad4140eaea96dad))
|
|
26
|
+
* **builders:** fast-usdc oracleSet option for MAINNET, ... ([3bf01a2](https://github.com/Agoric/agoric-sdk/commit/3bf01a279e5b2c72d6667704a07056501012260e))
|
|
27
|
+
* **builders:** fast-usdc policy update builder ([8ded3d8](https://github.com/Agoric/agoric-sdk/commit/8ded3d8be612a6944b80f3f63ab6fb727c76d179))
|
|
28
|
+
* chain-capabilities.js constants ([52ff70a](https://github.com/Agoric/agoric-sdk/commit/52ff70a187df1fadc89ccc506228bc6d0ca48da6))
|
|
29
|
+
* export `DenomDetailShape` ([2dfddb3](https://github.com/Agoric/agoric-sdk/commit/2dfddb3fb2018d769b1acc1b32f4ff3b4c7f67b7))
|
|
30
|
+
* export `OrchestrationPowersShape` ([34b61ea](https://github.com/Agoric/agoric-sdk/commit/34b61eae918a5f02ba6e06ac7e15b24750494821))
|
|
31
|
+
* **fast-usdc:** write chain policies to vstorage ([#10532](https://github.com/Agoric/agoric-sdk/issues/10532)) ([9d6cff1](https://github.com/Agoric/agoric-sdk/commit/9d6cff17bb95ce5557758da242ca4646a87ac5b0))
|
|
32
|
+
* fusdc assetInfo and chainInfo by netname ([afb4f34](https://github.com/Agoric/agoric-sdk/commit/afb4f34518124b3809d1df07ea706743fa47f2b1))
|
|
33
|
+
* parameterize fusdc with chainInfo and assetInfo ([e5a8b64](https://github.com/Agoric/agoric-sdk/commit/e5a8b6489368f0bf3a099ce4c5ddf9607a6192c1))
|
|
34
|
+
* record instances that will be replaced so we can manage them ([c883c39](https://github.com/Agoric/agoric-sdk/commit/c883c39bbe4ec236a758030508fdf9f4fbd3ba9b))
|
|
35
|
+
* register interchain bank assets proposal ([0e20707](https://github.com/Agoric/agoric-sdk/commit/0e2070754d6811acd40cb026792d4295189ae771))
|
|
36
|
+
* registerChainsAndAssets ([e72782d](https://github.com/Agoric/agoric-sdk/commit/e72782dcc748b9e6a2879179cccf9866718f4e00))
|
|
37
|
+
* save the outgoing EC Charter instance and kit ([c2c9be3](https://github.com/Agoric/agoric-sdk/commit/c2c9be3785f50e3b2cae3585d0e05d8b0a918283))
|
|
38
|
+
* send-anywhere inits chainHub ([2fa2f75](https://github.com/Agoric/agoric-sdk/commit/2fa2f7512b2a1a19d47f47b59e3206619794be18))
|
|
39
|
+
* upgrade v7-board and test it ([#10516](https://github.com/Agoric/agoric-sdk/issues/10516)) ([d8a109e](https://github.com/Agoric/agoric-sdk/commit/d8a109edcc78c977ef856131b52dd449e6a9d724)), closes [#10394](https://github.com/Agoric/agoric-sdk/issues/10394)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* **agd:** upgrade all orchestration vats to new liveslots ([59fa82c](https://github.com/Agoric/agoric-sdk/commit/59fa82c4740e1ddace28e1389e3c7c875bcdf93e))
|
|
45
|
+
* **orchestration:** denomAmounts must be non-negative ([#10458](https://github.com/Agoric/agoric-sdk/issues/10458)) ([40e0e4e](https://github.com/Agoric/agoric-sdk/commit/40e0e4e37503b611609d1752389477d8f14f1a8e))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
6
49
|
## [0.2.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/builders@0.2.0-u18.4...@agoric/builders@0.2.0-u18.5) (2024-12-17)
|
|
7
50
|
|
|
8
51
|
**Note:** Version bump only for package @agoric/builders
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/builders",
|
|
3
|
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-u18a.0",
|
|
4
4
|
"description": "Build scripts for proposals to an Agoric chain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -23,35 +23,37 @@
|
|
|
23
23
|
"author": "Agoric",
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@agoric/ertp": "^0.16.3-
|
|
27
|
-
"@agoric/
|
|
28
|
-
"@agoric/
|
|
29
|
-
"@agoric/
|
|
30
|
-
"@agoric/
|
|
31
|
-
"@agoric/
|
|
32
|
-
"@agoric/
|
|
33
|
-
"@
|
|
34
|
-
"@endo/
|
|
35
|
-
"@endo/
|
|
36
|
-
"@endo/
|
|
37
|
-
"@endo/
|
|
38
|
-
"@endo/
|
|
39
|
-
"@endo/
|
|
40
|
-
"@endo/
|
|
26
|
+
"@agoric/ertp": "^0.16.3-u18a.0",
|
|
27
|
+
"@agoric/fast-usdc": "^0.2.0-u18a.0",
|
|
28
|
+
"@agoric/internal": "^0.4.0-u18a.0",
|
|
29
|
+
"@agoric/notifier": "^0.7.0-u18a.0",
|
|
30
|
+
"@agoric/smart-wallet": "^0.5.4-u18a.0",
|
|
31
|
+
"@agoric/vat-data": "^0.5.3-u18a.0",
|
|
32
|
+
"@agoric/vats": "^0.16.0-u18a.0",
|
|
33
|
+
"@agoric/zoe": "^0.26.3-u18a.0",
|
|
34
|
+
"@endo/bundle-source": "^3.5.0",
|
|
35
|
+
"@endo/captp": "^4.4.3",
|
|
36
|
+
"@endo/eventual-send": "^1.2.8",
|
|
37
|
+
"@endo/far": "^1.1.9",
|
|
38
|
+
"@endo/init": "^1.1.7",
|
|
39
|
+
"@endo/marshal": "^1.6.2",
|
|
40
|
+
"@endo/patterns": "^1.4.7",
|
|
41
|
+
"@endo/promise-kit": "^1.1.8",
|
|
42
|
+
"@endo/stream": "^1.2.8",
|
|
41
43
|
"import-meta-resolve": "^2.2.1"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"@agoric/deploy-script-support": "^0.10.4-
|
|
45
|
-
"@agoric/governance": "^0.10.4-
|
|
46
|
-
"@agoric/inter-protocol": "^0.17.0-
|
|
47
|
-
"@agoric/orchestration": "^0.2.0-
|
|
48
|
-
"@agoric/store": "^0.9.3-u18.
|
|
49
|
-
"@agoric/swing-store": "^0.10.0-
|
|
50
|
-
"@agoric/swingset-liveslots": "^0.10.3-
|
|
51
|
-
"@agoric/time": "^0.3.3-u18.
|
|
52
|
-
"@endo/errors": "^1.2.
|
|
46
|
+
"@agoric/deploy-script-support": "^0.10.4-u18a.0",
|
|
47
|
+
"@agoric/governance": "^0.10.4-u18a.0",
|
|
48
|
+
"@agoric/inter-protocol": "^0.17.0-u18a.0",
|
|
49
|
+
"@agoric/orchestration": "^0.2.0-u18a.0",
|
|
50
|
+
"@agoric/store": "^0.9.3-u18.1",
|
|
51
|
+
"@agoric/swing-store": "^0.10.0-u18a.0",
|
|
52
|
+
"@agoric/swingset-liveslots": "^0.10.3-u18a.0",
|
|
53
|
+
"@agoric/time": "^0.3.3-u18.1",
|
|
54
|
+
"@endo/errors": "^1.2.8",
|
|
53
55
|
"ava": "^5.3.0",
|
|
54
|
-
"c8": "^
|
|
56
|
+
"c8": "^10.1.2"
|
|
55
57
|
},
|
|
56
58
|
"files": [
|
|
57
59
|
"CHANGELOG.md",
|
|
@@ -79,7 +81,7 @@
|
|
|
79
81
|
"workerThreads": false
|
|
80
82
|
},
|
|
81
83
|
"typeCoverage": {
|
|
82
|
-
"atLeast":
|
|
84
|
+
"atLeast": 90.93
|
|
83
85
|
},
|
|
84
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "4e4d2b4dedc5a268178712fc6beb89496518480a"
|
|
85
87
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { parseArgs } from 'node:util';
|
|
2
|
+
import { getManifestForUpdateFastUsdcPolicy } from '@agoric/fast-usdc/src/fast-usdc-policy.core.js';
|
|
3
|
+
import { toExternalConfig } from '@agoric/fast-usdc/src/utils/config-marshal.js';
|
|
4
|
+
import { FeedPolicyShape } from '@agoric/fast-usdc/src/type-guards.js';
|
|
5
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @import {CoreEvalBuilder, DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js'
|
|
9
|
+
* @import {ParseArgsConfig} from 'node:util'
|
|
10
|
+
* @import {FastUSDCConfig} from '@agoric/fast-usdc/src/types.js'
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** @type {ParseArgsConfig['options']} */
|
|
14
|
+
const options = {
|
|
15
|
+
feedPolicy: { type: 'string' },
|
|
16
|
+
};
|
|
17
|
+
const feedPolicyUsage = 'use --feedPolicy <policy> ...';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {{
|
|
21
|
+
* feedPolicy?: string;
|
|
22
|
+
* }} FastUSDCUpdateOpts
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** @type {CoreEvalBuilder} */
|
|
26
|
+
export const updateProposalBuilder = async (
|
|
27
|
+
_utils,
|
|
28
|
+
/** @type {FastUSDCConfig} */ config,
|
|
29
|
+
) => {
|
|
30
|
+
return harden({
|
|
31
|
+
sourceSpec: '@agoric/fast-usdc/src/fast-usdc-policy.core.js',
|
|
32
|
+
/** @type {[string, Parameters<typeof getManifestForUpdateFastUsdcPolicy>[1]]} */
|
|
33
|
+
getManifestCall: [
|
|
34
|
+
getManifestForUpdateFastUsdcPolicy.name,
|
|
35
|
+
{
|
|
36
|
+
options: toExternalConfig(
|
|
37
|
+
config,
|
|
38
|
+
{},
|
|
39
|
+
harden({ feedPolicy: FeedPolicyShape }),
|
|
40
|
+
),
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** @type {DeployScriptFunction} */
|
|
47
|
+
export default async (homeP, endowments) => {
|
|
48
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
49
|
+
const {
|
|
50
|
+
values: { feedPolicy },
|
|
51
|
+
} = parseArgs({ args: endowments.scriptArgs, options });
|
|
52
|
+
|
|
53
|
+
const parseFeedPolicy = () => {
|
|
54
|
+
if (typeof feedPolicy !== 'string') throw Error(feedPolicyUsage);
|
|
55
|
+
return JSON.parse(feedPolicy);
|
|
56
|
+
};
|
|
57
|
+
const config = harden({ feedPolicy: parseFeedPolicy() });
|
|
58
|
+
await writeCoreEval('eval-fast-usdc-policy-update', utils =>
|
|
59
|
+
updateProposalBuilder(utils, config),
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
3
|
+
import { AmountMath } from '@agoric/ertp';
|
|
4
|
+
import {
|
|
5
|
+
FastUSDCConfigShape,
|
|
6
|
+
getManifestForFastUSDC,
|
|
7
|
+
} from '@agoric/fast-usdc/src/fast-usdc.start.js';
|
|
8
|
+
import { toExternalConfig } from '@agoric/fast-usdc/src/utils/config-marshal.js';
|
|
9
|
+
import { configurations } from '@agoric/fast-usdc/src/utils/deploy-config.js';
|
|
10
|
+
import {
|
|
11
|
+
multiplyBy,
|
|
12
|
+
parseRatio,
|
|
13
|
+
} from '@agoric/zoe/src/contractSupport/ratio.js';
|
|
14
|
+
import { Far } from '@endo/far';
|
|
15
|
+
import { parseArgs } from 'node:util';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @import {CoreEvalBuilder, DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js'
|
|
19
|
+
* @import {ParseArgsConfig} from 'node:util'
|
|
20
|
+
* @import {FastUSDCConfig} from '@agoric/fast-usdc/src/types.js'
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const { keys } = Object;
|
|
24
|
+
|
|
25
|
+
/** @type {ParseArgsConfig['options']} */
|
|
26
|
+
const options = {
|
|
27
|
+
flatFee: { type: 'string', default: '0.01' },
|
|
28
|
+
variableRate: { type: 'string', default: '0.01' },
|
|
29
|
+
maxVariableFee: { type: 'string', default: '5' },
|
|
30
|
+
contractRate: { type: 'string', default: '0.2' },
|
|
31
|
+
net: { type: 'string' },
|
|
32
|
+
oracle: { type: 'string', multiple: true },
|
|
33
|
+
feedPolicy: { type: 'string' },
|
|
34
|
+
usdcDenom: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
default:
|
|
37
|
+
'ibc/FE98AAD68F02F03565E9FA39A5E627946699B2B07115889ED812D8BA639576A9',
|
|
38
|
+
},
|
|
39
|
+
chainInfo: { type: 'string' },
|
|
40
|
+
assetInfo: { type: 'string' },
|
|
41
|
+
noNoble: { type: 'boolean', default: false },
|
|
42
|
+
};
|
|
43
|
+
const oraclesUsage = 'use --oracle name:address ...';
|
|
44
|
+
|
|
45
|
+
const feedPolicyUsage = 'use --feedPolicy <policy> ...';
|
|
46
|
+
|
|
47
|
+
const chainInfoUsage = 'use --chainInfo {chainName:CosmosChainInfo, ...}';
|
|
48
|
+
const assetInfoUsage =
|
|
49
|
+
'use --assetInfo { denom:DenomInfo & {brandKey?: string} ... }';
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @typedef {{
|
|
53
|
+
* flatFee: string;
|
|
54
|
+
* variableRate: string;
|
|
55
|
+
* maxVariableFee: string;
|
|
56
|
+
* contractRate: string;
|
|
57
|
+
* net?: string;
|
|
58
|
+
* oracle?: string[];
|
|
59
|
+
* usdcDenom: string;
|
|
60
|
+
* feedPolicy?: string;
|
|
61
|
+
* chainInfo?: string;
|
|
62
|
+
* assetInfo?: string;
|
|
63
|
+
* noNoble: boolean;
|
|
64
|
+
* }} FastUSDCOpts
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
const crossVatContext = /** @type {const} */ ({
|
|
68
|
+
/** @type {Brand<'nat'>} */
|
|
69
|
+
USDC: Far('USDC Brand'),
|
|
70
|
+
});
|
|
71
|
+
const { USDC } = crossVatContext;
|
|
72
|
+
const USDC_DECIMALS = 6;
|
|
73
|
+
const unit = AmountMath.make(USDC, 10n ** BigInt(USDC_DECIMALS));
|
|
74
|
+
|
|
75
|
+
/** @type {CoreEvalBuilder} */
|
|
76
|
+
export const defaultProposalBuilder = async (
|
|
77
|
+
{ publishRef, install },
|
|
78
|
+
/** @type {FastUSDCConfig} */ config,
|
|
79
|
+
) => {
|
|
80
|
+
return harden({
|
|
81
|
+
sourceSpec: '@agoric/fast-usdc/src/fast-usdc.start.js',
|
|
82
|
+
/** @type {[string, Parameters<typeof getManifestForFastUSDC>[1]]} */
|
|
83
|
+
getManifestCall: [
|
|
84
|
+
getManifestForFastUSDC.name,
|
|
85
|
+
{
|
|
86
|
+
options: toExternalConfig(config, crossVatContext, FastUSDCConfigShape),
|
|
87
|
+
installKeys: {
|
|
88
|
+
fastUsdc: publishRef(
|
|
89
|
+
install('@agoric/fast-usdc/src/fast-usdc.contract.js'),
|
|
90
|
+
),
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** @type {DeployScriptFunction} */
|
|
98
|
+
export default async (homeP, endowments) => {
|
|
99
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
100
|
+
const { scriptArgs } = endowments;
|
|
101
|
+
|
|
102
|
+
/** @type {{ values: FastUSDCOpts }} */
|
|
103
|
+
// @ts-expect-error ensured by options
|
|
104
|
+
const {
|
|
105
|
+
values: {
|
|
106
|
+
oracle: oracleArgs,
|
|
107
|
+
net,
|
|
108
|
+
usdcDenom,
|
|
109
|
+
feedPolicy,
|
|
110
|
+
chainInfo,
|
|
111
|
+
assetInfo,
|
|
112
|
+
noNoble,
|
|
113
|
+
...fees
|
|
114
|
+
},
|
|
115
|
+
} = parseArgs({ args: scriptArgs, options });
|
|
116
|
+
|
|
117
|
+
const parseFeedPolicy = () => {
|
|
118
|
+
if (net) {
|
|
119
|
+
if (!(net in configurations)) {
|
|
120
|
+
throw Error(`${net} not in ${keys(configurations)}`);
|
|
121
|
+
}
|
|
122
|
+
return configurations[net].feedPolicy;
|
|
123
|
+
}
|
|
124
|
+
if (!feedPolicy) throw Error(feedPolicyUsage);
|
|
125
|
+
return JSON.parse(feedPolicy);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const parseOracleArgs = () => {
|
|
129
|
+
if (net) {
|
|
130
|
+
if (!(net in configurations)) {
|
|
131
|
+
throw Error(`${net} not in ${keys(configurations)}`);
|
|
132
|
+
}
|
|
133
|
+
return configurations[net].oracles;
|
|
134
|
+
}
|
|
135
|
+
if (!oracleArgs) throw Error(oraclesUsage);
|
|
136
|
+
return Object.fromEntries(
|
|
137
|
+
oracleArgs.map(arg => {
|
|
138
|
+
const result = arg.match(/(?<name>[^:]+):(?<address>.+)/);
|
|
139
|
+
if (!(result && result.groups)) throw Error(oraclesUsage);
|
|
140
|
+
const { name, address } = result.groups;
|
|
141
|
+
return [name, address];
|
|
142
|
+
}),
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/** @param {string} numeral */
|
|
147
|
+
const toAmount = numeral => multiplyBy(unit, parseRatio(numeral, USDC));
|
|
148
|
+
/** @param {string} numeral */
|
|
149
|
+
const toRatio = numeral => parseRatio(numeral, USDC);
|
|
150
|
+
const parseFeeConfigArgs = () => {
|
|
151
|
+
const { flatFee, variableRate, maxVariableFee, contractRate } = fees;
|
|
152
|
+
return {
|
|
153
|
+
flat: toAmount(flatFee),
|
|
154
|
+
variableRate: toRatio(variableRate),
|
|
155
|
+
maxVariable: toAmount(maxVariableFee),
|
|
156
|
+
contractRate: toRatio(contractRate),
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const parseChainInfo = () => {
|
|
161
|
+
if (net) {
|
|
162
|
+
if (!(net in configurations)) {
|
|
163
|
+
throw Error(`${net} not in ${keys(configurations)}`);
|
|
164
|
+
}
|
|
165
|
+
return configurations[net].chainInfo;
|
|
166
|
+
}
|
|
167
|
+
if (!chainInfo) throw Error(chainInfoUsage);
|
|
168
|
+
return JSON.parse(chainInfo);
|
|
169
|
+
};
|
|
170
|
+
const parseAssetInfo = () => {
|
|
171
|
+
if (net) {
|
|
172
|
+
if (!(net in configurations)) {
|
|
173
|
+
throw Error(`${net} not in ${keys(configurations)}`);
|
|
174
|
+
}
|
|
175
|
+
return configurations[net].assetInfo;
|
|
176
|
+
}
|
|
177
|
+
if (!assetInfo) throw Error(assetInfoUsage);
|
|
178
|
+
return JSON.parse(assetInfo);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/** @type {FastUSDCConfig} */
|
|
182
|
+
const config = harden({
|
|
183
|
+
oracles: parseOracleArgs(),
|
|
184
|
+
terms: {
|
|
185
|
+
usdcDenom,
|
|
186
|
+
},
|
|
187
|
+
feeConfig: parseFeeConfigArgs(),
|
|
188
|
+
feedPolicy: parseFeedPolicy(),
|
|
189
|
+
chainInfo: parseChainInfo(),
|
|
190
|
+
assetInfo: parseAssetInfo(),
|
|
191
|
+
noNoble,
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
await writeCoreEval('start-fast-usdc', utils =>
|
|
195
|
+
defaultProposalBuilder(utils, config),
|
|
196
|
+
);
|
|
197
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { getManifestForReplaceFeeDistributor } from '@agoric/inter-protocol/src/proposals/replace-fee-distributor.js';
|
|
3
|
+
import { SECONDS_PER_HOUR } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
|
|
4
|
+
|
|
5
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
6
|
+
export const defaultProposalBuilder = async (_, opts) => {
|
|
7
|
+
console.log('feeDist OPTS', opts);
|
|
8
|
+
return harden({
|
|
9
|
+
sourceSpec:
|
|
10
|
+
'@agoric/inter-protocol/src/proposals/replace-fee-distributor.js',
|
|
11
|
+
getManifestCall: [getManifestForReplaceFeeDistributor.name, { ...opts }],
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
16
|
+
export default async (homeP, endowments) => {
|
|
17
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
18
|
+
|
|
19
|
+
await writeCoreEval('replace-feeDistributor', utils =>
|
|
20
|
+
defaultProposalBuilder(utils, {
|
|
21
|
+
collectionInterval: 1n * SECONDS_PER_HOUR,
|
|
22
|
+
keywordShares: {
|
|
23
|
+
RewardDistributor: 0n,
|
|
24
|
+
Reserve: 1n,
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
2
|
import { startBasicFlows } from '@agoric/orchestration/src/proposals/start-basic-flows.js';
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @import {ParseArgsConfig} from 'node:util'
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** @type {ParseArgsConfig['options']} */
|
|
10
|
+
const parserOpts = {
|
|
11
|
+
chainInfo: { type: 'string' },
|
|
12
|
+
assetInfo: { type: 'string' },
|
|
13
|
+
};
|
|
3
14
|
|
|
4
15
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
5
|
-
export const defaultProposalBuilder = async (
|
|
16
|
+
export const defaultProposalBuilder = async (
|
|
17
|
+
{ publishRef, install },
|
|
18
|
+
options,
|
|
19
|
+
) => {
|
|
6
20
|
return harden({
|
|
7
21
|
sourceSpec: '@agoric/orchestration/src/proposals/start-basic-flows.js',
|
|
8
22
|
getManifestCall: [
|
|
@@ -15,6 +29,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
|
15
29
|
),
|
|
16
30
|
),
|
|
17
31
|
},
|
|
32
|
+
options,
|
|
18
33
|
},
|
|
19
34
|
],
|
|
20
35
|
});
|
|
@@ -22,6 +37,31 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
|
22
37
|
|
|
23
38
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
24
39
|
export default async (homeP, endowments) => {
|
|
40
|
+
const { scriptArgs } = endowments;
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
values: { chainInfo, assetInfo },
|
|
44
|
+
} = parseArgs({
|
|
45
|
+
args: scriptArgs,
|
|
46
|
+
options: parserOpts,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const parseChainInfo = () => {
|
|
50
|
+
if (typeof chainInfo !== 'string') return undefined;
|
|
51
|
+
return JSON.parse(chainInfo);
|
|
52
|
+
};
|
|
53
|
+
const parseAssetInfo = () => {
|
|
54
|
+
if (typeof assetInfo !== 'string') return undefined;
|
|
55
|
+
return JSON.parse(assetInfo);
|
|
56
|
+
};
|
|
57
|
+
const opts = harden({
|
|
58
|
+
chainInfo: parseChainInfo(),
|
|
59
|
+
assetInfo: parseAssetInfo(),
|
|
60
|
+
});
|
|
61
|
+
|
|
25
62
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
26
|
-
|
|
63
|
+
|
|
64
|
+
await writeCoreEval(startBasicFlows.name, utils =>
|
|
65
|
+
defaultProposalBuilder(utils, opts),
|
|
66
|
+
);
|
|
27
67
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { psmProposalBuilder } from '../inter-protocol/add-collateral-core.js';
|
|
3
|
+
|
|
4
|
+
const addUsdLemonsProposalBuilder = async powers => {
|
|
5
|
+
return psmProposalBuilder(powers, {
|
|
6
|
+
anchorOptions: {
|
|
7
|
+
denom: 'ibc/000C0AAAEECAFE000',
|
|
8
|
+
keyword: 'USD_LEMONS',
|
|
9
|
+
decimalPlaces: 6,
|
|
10
|
+
proposedName: 'USD_LEMONS',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
16
|
+
export default async (homeP, endowments) => {
|
|
17
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
18
|
+
await writeCoreEval('add-LEMONS-PSM', addUsdLemonsProposalBuilder);
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { psmProposalBuilder } from '../inter-protocol/add-collateral-core.js';
|
|
3
|
+
|
|
4
|
+
const addUsdOlivesProposalBuilder = async powers => {
|
|
5
|
+
return psmProposalBuilder(powers, {
|
|
6
|
+
anchorOptions: {
|
|
7
|
+
denom: 'ibc/000C0AAAEECAFE111',
|
|
8
|
+
keyword: 'USD_OLIVES',
|
|
9
|
+
decimalPlaces: 6,
|
|
10
|
+
proposedName: 'USD_OLIVES',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
16
|
+
export default async (homeP, endowments) => {
|
|
17
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
18
|
+
await writeCoreEval('add-OLIVES-PSM', addUsdOlivesProposalBuilder);
|
|
19
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file A proposal to start the auto-stake-it contract.
|
|
3
|
+
*
|
|
4
|
+
* AutoStakeIt allows users to to create an auto-forwarding address that
|
|
5
|
+
* transfers and stakes tokens on a remote chain when received.
|
|
6
|
+
*/
|
|
7
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
8
|
+
import { startAutoStakeIt } from '@agoric/orchestration/src/proposals/start-auto-stake-it.js';
|
|
9
|
+
import { parseArgs } from 'node:util';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @import {ParseArgsConfig} from 'node:util'
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** @type {ParseArgsConfig['options']} */
|
|
16
|
+
const parserOpts = {
|
|
17
|
+
chainInfo: { type: 'string' },
|
|
18
|
+
assetInfo: { type: 'string' },
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
22
|
+
export const defaultProposalBuilder = async (
|
|
23
|
+
{ publishRef, install },
|
|
24
|
+
options,
|
|
25
|
+
) => {
|
|
26
|
+
return harden({
|
|
27
|
+
sourceSpec: '@agoric/orchestration/src/proposals/start-auto-stake-it.js',
|
|
28
|
+
getManifestCall: [
|
|
29
|
+
'getManifest',
|
|
30
|
+
{
|
|
31
|
+
installKeys: {
|
|
32
|
+
autoAutoStakeIt: publishRef(
|
|
33
|
+
install(
|
|
34
|
+
'@agoric/orchestration/src/examples/auto-stake-it.contract.js',
|
|
35
|
+
),
|
|
36
|
+
),
|
|
37
|
+
},
|
|
38
|
+
options,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
45
|
+
export default async (homeP, endowments) => {
|
|
46
|
+
const { scriptArgs } = endowments;
|
|
47
|
+
|
|
48
|
+
const {
|
|
49
|
+
values: { chainInfo, assetInfo },
|
|
50
|
+
} = parseArgs({
|
|
51
|
+
args: scriptArgs,
|
|
52
|
+
options: parserOpts,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const parseChainInfo = () => {
|
|
56
|
+
if (typeof chainInfo !== 'string') return undefined;
|
|
57
|
+
return JSON.parse(chainInfo);
|
|
58
|
+
};
|
|
59
|
+
const parseAssetInfo = () => {
|
|
60
|
+
if (typeof assetInfo !== 'string') return undefined;
|
|
61
|
+
return JSON.parse(assetInfo);
|
|
62
|
+
};
|
|
63
|
+
const opts = harden({
|
|
64
|
+
chainInfo: parseChainInfo(),
|
|
65
|
+
assetInfo: parseAssetInfo(),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
69
|
+
|
|
70
|
+
await writeCoreEval(startAutoStakeIt.name, utils =>
|
|
71
|
+
defaultProposalBuilder(utils, opts),
|
|
72
|
+
);
|
|
73
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import {
|
|
3
|
+
getManifest,
|
|
4
|
+
startSendAnywhere,
|
|
5
|
+
} from '@agoric/orchestration/src/proposals/start-send-anywhere.js';
|
|
6
|
+
import { parseArgs } from 'node:util';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @import {ParseArgsConfig} from 'node:util'
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** @type {ParseArgsConfig['options']} */
|
|
13
|
+
const parserOpts = {
|
|
14
|
+
chainInfo: { type: 'string' },
|
|
15
|
+
assetInfo: { type: 'string' },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
19
|
+
export const defaultProposalBuilder = async (
|
|
20
|
+
{ publishRef, install },
|
|
21
|
+
options,
|
|
22
|
+
) =>
|
|
23
|
+
harden({
|
|
24
|
+
sourceSpec: '@agoric/orchestration/src/proposals/start-send-anywhere.js',
|
|
25
|
+
getManifestCall: [
|
|
26
|
+
getManifest.name,
|
|
27
|
+
{
|
|
28
|
+
installationRef: publishRef(
|
|
29
|
+
install(
|
|
30
|
+
'@agoric/orchestration/src/examples/send-anywhere.contract.js',
|
|
31
|
+
),
|
|
32
|
+
),
|
|
33
|
+
options,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
39
|
+
export default async (homeP, endowments) => {
|
|
40
|
+
const { scriptArgs } = endowments;
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
values: { chainInfo, assetInfo },
|
|
44
|
+
} = parseArgs({
|
|
45
|
+
args: scriptArgs,
|
|
46
|
+
options: parserOpts,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const parseChainInfo = () => {
|
|
50
|
+
if (typeof chainInfo !== 'string') return undefined;
|
|
51
|
+
return JSON.parse(chainInfo);
|
|
52
|
+
};
|
|
53
|
+
const parseAssetInfo = () => {
|
|
54
|
+
if (typeof assetInfo !== 'string') return undefined;
|
|
55
|
+
return JSON.parse(assetInfo);
|
|
56
|
+
};
|
|
57
|
+
const opts = harden({
|
|
58
|
+
chainInfo: parseChainInfo(),
|
|
59
|
+
assetInfo: parseAssetInfo(),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
63
|
+
|
|
64
|
+
await writeCoreEval(startSendAnywhere.name, utils =>
|
|
65
|
+
defaultProposalBuilder(utils, opts),
|
|
66
|
+
);
|
|
67
|
+
};
|