@agoric/builders 0.1.1-other-dev-3eb1a1d.0 → 0.1.1-other-dev-d15096d.0.d15096d
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/package.json +38 -37
- package/scripts/inter-protocol/add-STARS.js +8 -3
- package/scripts/inter-protocol/add-collateral-core.js +10 -4
- package/scripts/inter-protocol/init-core.js +7 -2
- package/scripts/inter-protocol/invite-committee-core.js +7 -2
- package/scripts/inter-protocol/manual-price-feed.js +5 -1
- package/scripts/inter-protocol/price-feed-core.js +5 -1
- package/scripts/inter-protocol/replace-electorate-core.js +9 -3
- package/scripts/inter-protocol/replace-feeDistributor-combo.js +87 -0
- package/scripts/inter-protocol/replace-feeDistributor.js +19 -6
- package/scripts/inter-protocol/updatePriceFeeds.js +18 -4
- package/scripts/inter-protocol/withdraw-reserve.build.js +73 -0
- package/scripts/inter-protocol/withdraw-vbank-reserve-permit.json +6 -0
- package/scripts/inter-protocol/withdraw-vbank-reserve.js +67 -0
- package/scripts/orchestration/axelar-gmp.build.js +83 -0
- package/scripts/orchestration/get-chain-config.js +121 -0
- package/scripts/orchestration/helpers.js +46 -0
- package/scripts/orchestration/hook-localchain-msg-send.js +35 -0
- package/scripts/orchestration/init-basic-flows.js +18 -4
- package/scripts/orchestration/init-stakeAtom.js +18 -4
- package/scripts/orchestration/init-stakeBld.js +7 -2
- package/scripts/orchestration/init-stakeOsmo.js +18 -4
- package/scripts/orchestration/write-chain-info.js +7 -2
- package/scripts/pegasus/init-core.js +7 -2
- package/scripts/smart-wallet/build-game1-start.js +7 -2
- package/scripts/smart-wallet/build-wallet-factory2-upgrade.js +7 -2
- package/scripts/smart-wallet/build-walletFactory-upgrade.js +7 -2
- package/scripts/testing/add-LEMONS.js +7 -2
- package/scripts/testing/add-OLIVES.js +7 -2
- package/scripts/testing/add-USD-LEMONS.js +23 -0
- package/scripts/testing/add-USD-OLIVES.js +23 -0
- package/scripts/testing/append-chain-info.js +12 -4
- package/scripts/testing/init-auto-stake-it.js +47 -0
- package/scripts/testing/init-send-anywhere.js +41 -0
- package/scripts/testing/init-swap-anything.js +41 -0
- package/scripts/testing/provokeBOYD.js +58 -0
- package/scripts/testing/publish-test-info.js +84 -0
- package/scripts/testing/recorded-retired-instances.js +86 -0
- package/scripts/testing/register-interchain-bank-assets.js +199 -0
- package/scripts/testing/replace-feeDistributor-short.js +14 -3
- package/scripts/testing/restart-axelar-gmp.js +96 -0
- package/scripts/testing/restart-basic-flows.js +5 -3
- package/scripts/testing/restart-send-anywhere.js +5 -3
- package/scripts/testing/restart-stakeAtom.js +5 -3
- package/scripts/testing/restart-valueVow.js +7 -4
- package/scripts/testing/start-query-flows.js +47 -25
- package/scripts/testing/start-valueVow.js +7 -4
- package/scripts/testing/test-upgraded-board.js +20 -0
- package/scripts/testing/tweak-chain-info.js +15 -4
- package/scripts/testing/{fix-buggy-sendAnywhere.js → upgrade-send-anywhere.js} +19 -21
- package/scripts/testing/upgrade-vaultFactory.js +26 -0
- package/scripts/vats/add-auction.js +7 -2
- package/scripts/vats/init-core.js +7 -2
- package/scripts/vats/init-localchain.js +7 -2
- package/scripts/vats/init-network.js +7 -2
- package/scripts/vats/init-orchestration.js +7 -2
- package/scripts/vats/init-transfer.js +7 -2
- package/scripts/vats/priceFeedSupport.js +7 -3
- package/scripts/vats/probe-zcf-bundle.js +7 -2
- package/scripts/vats/replace-provisioning.js +7 -2
- package/scripts/vats/replace-zoe.js +7 -2
- package/scripts/vats/restart-vats.js +7 -2
- package/scripts/vats/revive-kread.js +7 -2
- package/scripts/vats/test-localchain.js +7 -2
- package/scripts/vats/test-vtransfer.js +7 -2
- package/scripts/vats/updateAtomPriceFeed.js +7 -2
- package/scripts/vats/updateStAtomPriceFeed.js +7 -2
- package/scripts/vats/updateStOsmoPriceFeed.js +7 -2
- package/scripts/vats/updateStTiaPriceFeed.js +7 -2
- package/scripts/vats/updateStkAtomPriceFeed.js +7 -2
- package/scripts/vats/upgrade-agoricNames.js +26 -0
- package/scripts/vats/upgrade-asset-reserve.js +26 -0
- package/scripts/vats/upgrade-bank.js +9 -4
- package/scripts/vats/upgrade-board.js +25 -0
- package/scripts/vats/upgrade-mintHolder.js +110 -0
- package/scripts/vats/upgrade-orchestration.js +26 -0
- package/scripts/vats/upgrade-paRegistry.js +26 -0
- package/scripts/vats/upgrade-provisionPool-to-BLD.js +30 -0
- package/scripts/vats/upgrade-provisionPool.js +7 -2
- package/scripts/vats/upgrade-psm.js +24 -0
- package/scripts/vats/upgrade-vats.js +53 -0
- package/scripts/vats/upgrade-zcf.js +7 -2
- package/scripts/vats/upgrade-zoe.js +7 -2
- package/scripts/vats/upgradeScaledPriceAuthorities.js +7 -2
- package/scripts/vats/upgradeVaults.js +7 -2
- package/index.js +0 -0
- package/scripts/fast-usdc/init-fast-usdc.js +0 -242
- 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/scripts/vats/upgrade-orch-core.js +0 -24
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { upgradeVatsProposalBuilder } from './upgrade-vats.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
6
|
+
* @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** @type {CoreEvalBuilder} */
|
|
10
|
+
export const defaultProposalBuilder = async powers => {
|
|
11
|
+
const bundleRecord = {
|
|
12
|
+
ibc: '@agoric/vats/src/vat-ibc.js',
|
|
13
|
+
network: '@agoric/vats/src/vat-network.js',
|
|
14
|
+
localchain: '@agoric/vats/src/vat-localchain.js',
|
|
15
|
+
transfer: '@agoric/vats/src/vat-transfer.js',
|
|
16
|
+
orchestration: '@agoric/orchestration/src/vat-orchestration.js',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return upgradeVatsProposalBuilder(powers, bundleRecord);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @type {DeployScriptFunction} */
|
|
23
|
+
export default async (homeP, endowments) => {
|
|
24
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
25
|
+
await writeCoreProposal('upgrade-orchestration', defaultProposalBuilder);
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
5
|
+
* @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {CoreEvalBuilder} */
|
|
9
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
10
|
+
harden({
|
|
11
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-paRegistry-proposal.js',
|
|
12
|
+
getManifestCall: [
|
|
13
|
+
'getManifestForUpgradingRegistry',
|
|
14
|
+
{
|
|
15
|
+
registryRef: publishRef(
|
|
16
|
+
install('@agoric/vats/src/vat-priceAuthority.js'),
|
|
17
|
+
),
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/** @type {DeployScriptFunction} */
|
|
23
|
+
export default async (homeP, endowments) => {
|
|
24
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
25
|
+
await writeCoreEval('upgrade-paRegistry', defaultProposalBuilder);
|
|
26
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
5
|
+
* @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {CoreEvalBuilder} */
|
|
9
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
10
|
+
harden({
|
|
11
|
+
sourceSpec:
|
|
12
|
+
'@agoric/vats/src/proposals/upgrade-provisionPool-to-BLD-proposal.js',
|
|
13
|
+
getManifestCall: [
|
|
14
|
+
'getManifestForUpgradingProvisionPool',
|
|
15
|
+
{
|
|
16
|
+
provisionPoolRef: publishRef(
|
|
17
|
+
install('@agoric/inter-protocol/src/provisionPool.js'),
|
|
18
|
+
),
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/** @type {DeployScriptFunction} */
|
|
24
|
+
export default async (homeP, endowments) => {
|
|
25
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
26
|
+
await writeCoreProposal(
|
|
27
|
+
'upgrade-provision-pool-to-BLD',
|
|
28
|
+
defaultProposalBuilder,
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
5
|
+
* @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {CoreEvalBuilder} */
|
|
4
9
|
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
10
|
harden({
|
|
6
11
|
sourceSpec: '@agoric/vats/src/proposals/upgrade-provisionPool-proposal.js',
|
|
@@ -14,7 +19,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
|
14
19
|
],
|
|
15
20
|
});
|
|
16
21
|
|
|
17
|
-
/** @type {
|
|
22
|
+
/** @type {DeployScriptFunction} */
|
|
18
23
|
export default async (homeP, endowments) => {
|
|
19
24
|
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
20
25
|
await writeCoreProposal('upgrade-provision-pool', defaultProposalBuilder);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
5
|
+
* @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {CoreEvalBuilder} */
|
|
9
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
10
|
+
harden({
|
|
11
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-psm-proposal.js',
|
|
12
|
+
getManifestCall: [
|
|
13
|
+
'getManifestForUpgradingPSM',
|
|
14
|
+
{
|
|
15
|
+
psmRef: publishRef(install('@agoric/inter-protocol/src/psm/psm.js')),
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/** @type {DeployScriptFunction} */
|
|
21
|
+
export default async (homeP, endowments) => {
|
|
22
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
23
|
+
await writeCoreEval('upgrade-psm', defaultProposalBuilder);
|
|
24
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** @type {CoreEvalBuilder} */
|
|
2
|
+
export const upgradeVatsProposalBuilder = async (
|
|
3
|
+
{ publishRef, install },
|
|
4
|
+
vatNameToEntrypoint,
|
|
5
|
+
) => {
|
|
6
|
+
if (!vatNameToEntrypoint) {
|
|
7
|
+
throw Error('Missing vatNameToEntrypoint');
|
|
8
|
+
}
|
|
9
|
+
return harden({
|
|
10
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-vats-generic-proposal.js',
|
|
11
|
+
getManifestCall: [
|
|
12
|
+
'getManifestForUpgradingVats',
|
|
13
|
+
{
|
|
14
|
+
bundleRefs: Object.fromEntries(
|
|
15
|
+
Object.entries(vatNameToEntrypoint).map(
|
|
16
|
+
([name, entrypoint]) =>
|
|
17
|
+
/** @type {const} */ ([name, publishRef(install(entrypoint))]),
|
|
18
|
+
),
|
|
19
|
+
),
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** @type {CoreEvalBuilder} */
|
|
30
|
+
export const upgradeZoeContractsProposalBuilder = async (
|
|
31
|
+
{ publishRef, install },
|
|
32
|
+
contractKitSpecs,
|
|
33
|
+
) => {
|
|
34
|
+
if (!contractKitSpecs) {
|
|
35
|
+
throw Error('Missing contractKitSpecs');
|
|
36
|
+
}
|
|
37
|
+
return harden({
|
|
38
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-vats-generic-proposal.js',
|
|
39
|
+
getManifestCall: [
|
|
40
|
+
'getManifestForUpgradingZoeContractKits',
|
|
41
|
+
{
|
|
42
|
+
contractKitSpecs,
|
|
43
|
+
/** @type {{ [bundleName: string]: VatSourceRef }} */
|
|
44
|
+
installationBundleRefs: Object.fromEntries(
|
|
45
|
+
contractKitSpecs.map(({ bundleName, entrypoint }) => [
|
|
46
|
+
bundleName,
|
|
47
|
+
publishRef(install(entrypoint)),
|
|
48
|
+
]),
|
|
49
|
+
),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
5
|
+
* @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {CoreEvalBuilder} */
|
|
4
9
|
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
10
|
harden({
|
|
6
11
|
sourceSpec: '@agoric/vats/src/proposals/zcf-only-proposal.js',
|
|
@@ -12,7 +17,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
|
12
17
|
],
|
|
13
18
|
});
|
|
14
19
|
|
|
15
|
-
/** @type {
|
|
20
|
+
/** @type {DeployScriptFunction} */
|
|
16
21
|
export default async (homeP, endowments) => {
|
|
17
22
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
18
23
|
await writeCoreEval('upgrade-zcf', defaultProposalBuilder);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
5
|
+
* @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {CoreEvalBuilder} */
|
|
4
9
|
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
10
|
harden({
|
|
6
11
|
sourceSpec: '@agoric/vats/src/proposals/upgrade-zoe-proposal.js',
|
|
@@ -12,7 +17,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
|
12
17
|
],
|
|
13
18
|
});
|
|
14
19
|
|
|
15
|
-
/** @type {
|
|
20
|
+
/** @type {DeployScriptFunction} */
|
|
16
21
|
export default async (homeP, endowments) => {
|
|
17
22
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
18
23
|
await writeCoreEval('upgrade-zoe', defaultProposalBuilder);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
5
|
+
* @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {CoreEvalBuilder} */
|
|
4
9
|
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
10
|
harden({
|
|
6
11
|
sourceSpec:
|
|
@@ -15,7 +20,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
|
15
20
|
],
|
|
16
21
|
});
|
|
17
22
|
|
|
18
|
-
/** @type {
|
|
23
|
+
/** @type {DeployScriptFunction} */
|
|
19
24
|
export default async (homeP, endowments) => {
|
|
20
25
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
21
26
|
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
5
|
+
* @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {CoreEvalBuilder} */
|
|
4
9
|
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
10
|
harden({
|
|
6
11
|
sourceSpec: '@agoric/inter-protocol/src/proposals/upgrade-vaults.js',
|
|
@@ -17,7 +22,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
|
17
22
|
],
|
|
18
23
|
});
|
|
19
24
|
|
|
20
|
-
/** @type {
|
|
25
|
+
/** @type {DeployScriptFunction} */
|
|
21
26
|
export default async (homeP, endowments) => {
|
|
22
27
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
23
28
|
await writeCoreEval('upgrade-vaults', defaultProposalBuilder);
|
package/index.js
DELETED
|
File without changes
|
|
@@ -1,242 +0,0 @@
|
|
|
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 {
|
|
10
|
-
multiplyBy,
|
|
11
|
-
parseRatio,
|
|
12
|
-
} from '@agoric/zoe/src/contractSupport/ratio.js';
|
|
13
|
-
import { Far } from '@endo/far';
|
|
14
|
-
import { parseArgs } from 'node:util';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @import {CoreEvalBuilder, DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js'
|
|
18
|
-
* @import {ParseArgsConfig} from 'node:util'
|
|
19
|
-
* @import {FastUSDCConfig} from '@agoric/fast-usdc/src/fast-usdc.start.js'
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
const { keys } = Object;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @type {Record<string, Pick<FastUSDCConfig, 'oracles' | 'feedPolicy'>>}
|
|
26
|
-
*
|
|
27
|
-
* TODO: determine OCW operator addresses
|
|
28
|
-
* meanwhile, use price oracle addresses (from updatePriceFeeds.js).
|
|
29
|
-
*/
|
|
30
|
-
const configurations = {
|
|
31
|
-
A3P_INTEGRATION: {
|
|
32
|
-
oracles: {
|
|
33
|
-
gov1: 'agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q',
|
|
34
|
-
gov2: 'agoric1wrfh296eu2z34p6pah7q04jjuyj3mxu9v98277',
|
|
35
|
-
gov3: 'agoric1ydzxwh6f893jvpaslmaz6l8j2ulup9a7x8qvvq',
|
|
36
|
-
},
|
|
37
|
-
feedPolicy: {
|
|
38
|
-
nobleAgoricChannelId: 'TODO',
|
|
39
|
-
nobleDomainId: 4,
|
|
40
|
-
chainPolicies: {
|
|
41
|
-
Arbitrum: {
|
|
42
|
-
cctpTokenMessengerAddress:
|
|
43
|
-
'0x19330d10D9Cc8751218eaf51E8885D058642E08A',
|
|
44
|
-
chainId: 42161,
|
|
45
|
-
confirmations: 2,
|
|
46
|
-
nobleContractAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
MAINNET: {
|
|
52
|
-
oracles: {
|
|
53
|
-
DSRV: 'agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78',
|
|
54
|
-
Stakin: 'agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p',
|
|
55
|
-
'01node': 'agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8',
|
|
56
|
-
'Simply Staking': 'agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr',
|
|
57
|
-
P2P: 'agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj',
|
|
58
|
-
},
|
|
59
|
-
feedPolicy: {
|
|
60
|
-
nobleAgoricChannelId: 'channel-21',
|
|
61
|
-
nobleDomainId: 4,
|
|
62
|
-
chainPolicies: {
|
|
63
|
-
Arbitrum: {
|
|
64
|
-
cctpTokenMessengerAddress:
|
|
65
|
-
'0x19330d10D9Cc8751218eaf51E8885D058642E08A',
|
|
66
|
-
chainId: 42161,
|
|
67
|
-
confirmations: 2,
|
|
68
|
-
nobleContractAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
DEVNET: {
|
|
74
|
-
oracles: {
|
|
75
|
-
DSRV: 'agoric1lw4e4aas9q84tq0q92j85rwjjjapf8dmnllnft',
|
|
76
|
-
Stakin: 'agoric1zj6vrrrjq4gsyr9lw7dplv4vyejg3p8j2urm82',
|
|
77
|
-
'01node': 'agoric1ra0g6crtsy6r3qnpu7ruvm7qd4wjnznyzg5nu4',
|
|
78
|
-
'Simply Staking': 'agoric1qj07c7vfk3knqdral0sej7fa6eavkdn8vd8etf',
|
|
79
|
-
P2P: 'agoric10vjkvkmpp9e356xeh6qqlhrny2htyzp8hf88fk',
|
|
80
|
-
},
|
|
81
|
-
feedPolicy: {
|
|
82
|
-
nobleAgoricChannelId: 'TODO',
|
|
83
|
-
nobleDomainId: 4,
|
|
84
|
-
chainPolicies: {
|
|
85
|
-
Arbitrum: {
|
|
86
|
-
cctpTokenMessengerAddress: '0xTODO',
|
|
87
|
-
chainId: 421614,
|
|
88
|
-
confirmations: 2,
|
|
89
|
-
nobleContractAddress: '0xTODO',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
EMERYNET: {
|
|
95
|
-
oracles: {
|
|
96
|
-
gov1: 'agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce',
|
|
97
|
-
gov2: 'agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang',
|
|
98
|
-
},
|
|
99
|
-
feedPolicy: {
|
|
100
|
-
nobleAgoricChannelId: 'TODO',
|
|
101
|
-
nobleDomainId: 4,
|
|
102
|
-
chainPolicies: {
|
|
103
|
-
Arbitrum: {
|
|
104
|
-
cctpTokenMessengerAddress: '0xTODO',
|
|
105
|
-
chainId: 421614,
|
|
106
|
-
confirmations: 2,
|
|
107
|
-
nobleContractAddress: '0xTODO',
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
/** @type {ParseArgsConfig['options']} */
|
|
115
|
-
const options = {
|
|
116
|
-
flatFee: { type: 'string', default: '0.01' },
|
|
117
|
-
variableRate: { type: 'string', default: '0.01' },
|
|
118
|
-
maxVariableFee: { type: 'string', default: '5' },
|
|
119
|
-
contractRate: { type: 'string', default: '0.2' },
|
|
120
|
-
net: { type: 'string' },
|
|
121
|
-
oracle: { type: 'string', multiple: true },
|
|
122
|
-
usdcDenom: {
|
|
123
|
-
type: 'string',
|
|
124
|
-
default:
|
|
125
|
-
'ibc/FE98AAD68F02F03565E9FA39A5E627946699B2B07115889ED812D8BA639576A9',
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
const oraclesUsage = 'use --oracle name:address ...';
|
|
129
|
-
|
|
130
|
-
const feedPolicyUsage = 'use --feedPolicy <policy> ...';
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* @typedef {{
|
|
134
|
-
* flatFee: string;
|
|
135
|
-
* variableRate: string;
|
|
136
|
-
* maxVariableFee: string;
|
|
137
|
-
* contractRate: string;
|
|
138
|
-
* net?: string;
|
|
139
|
-
* oracle?: string[];
|
|
140
|
-
* usdcDenom: string;
|
|
141
|
-
* feedPolicy?: string;
|
|
142
|
-
* }} FastUSDCOpts
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
const crossVatContext = /** @type {const} */ ({
|
|
146
|
-
/** @type {Brand<'nat'>} */
|
|
147
|
-
USDC: Far('USDC Brand'),
|
|
148
|
-
});
|
|
149
|
-
const { USDC } = crossVatContext;
|
|
150
|
-
const USDC_DECIMALS = 6;
|
|
151
|
-
const unit = AmountMath.make(USDC, 10n ** BigInt(USDC_DECIMALS));
|
|
152
|
-
|
|
153
|
-
/** @type {CoreEvalBuilder} */
|
|
154
|
-
export const defaultProposalBuilder = async (
|
|
155
|
-
{ publishRef, install },
|
|
156
|
-
/** @type {FastUSDCConfig} */ config,
|
|
157
|
-
) => {
|
|
158
|
-
return harden({
|
|
159
|
-
sourceSpec: '@agoric/fast-usdc/src/fast-usdc.start.js',
|
|
160
|
-
/** @type {[string, Parameters<typeof getManifestForFastUSDC>[1]]} */
|
|
161
|
-
getManifestCall: [
|
|
162
|
-
getManifestForFastUSDC.name,
|
|
163
|
-
{
|
|
164
|
-
options: toExternalConfig(config, crossVatContext, FastUSDCConfigShape),
|
|
165
|
-
installKeys: {
|
|
166
|
-
fastUsdc: publishRef(
|
|
167
|
-
install('@agoric/fast-usdc/src/fast-usdc.contract.js'),
|
|
168
|
-
),
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
/** @type {DeployScriptFunction} */
|
|
176
|
-
export default async (homeP, endowments) => {
|
|
177
|
-
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
178
|
-
const { scriptArgs } = endowments;
|
|
179
|
-
|
|
180
|
-
/** @type {{ values: FastUSDCOpts }} */
|
|
181
|
-
// @ts-expect-error ensured by options
|
|
182
|
-
const {
|
|
183
|
-
values: { oracle: oracleArgs, net, usdcDenom, feedPolicy, ...fees },
|
|
184
|
-
} = parseArgs({ args: scriptArgs, options });
|
|
185
|
-
|
|
186
|
-
const parseFeedPolicy = () => {
|
|
187
|
-
if (net) {
|
|
188
|
-
if (!(net in configurations)) {
|
|
189
|
-
throw Error(`${net} not in ${keys(configurations)}`);
|
|
190
|
-
}
|
|
191
|
-
return configurations[net].feedPolicy;
|
|
192
|
-
}
|
|
193
|
-
if (!feedPolicy) throw Error(feedPolicyUsage);
|
|
194
|
-
return JSON.parse(feedPolicy);
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
const parseOracleArgs = () => {
|
|
198
|
-
if (net) {
|
|
199
|
-
if (!(net in configurations)) {
|
|
200
|
-
throw Error(`${net} not in ${keys(configurations)}`);
|
|
201
|
-
}
|
|
202
|
-
return configurations[net].oracles;
|
|
203
|
-
}
|
|
204
|
-
if (!oracleArgs) throw Error(oraclesUsage);
|
|
205
|
-
return Object.fromEntries(
|
|
206
|
-
oracleArgs.map(arg => {
|
|
207
|
-
const result = arg.match(/(?<name>[^:]+):(?<address>.+)/);
|
|
208
|
-
if (!(result && result.groups)) throw Error(oraclesUsage);
|
|
209
|
-
const { name, address } = result.groups;
|
|
210
|
-
return [name, address];
|
|
211
|
-
}),
|
|
212
|
-
);
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
/** @param {string} numeral */
|
|
216
|
-
const toAmount = numeral => multiplyBy(unit, parseRatio(numeral, USDC));
|
|
217
|
-
/** @param {string} numeral */
|
|
218
|
-
const toRatio = numeral => parseRatio(numeral, USDC);
|
|
219
|
-
const parseFeeConfigArgs = () => {
|
|
220
|
-
const { flatFee, variableRate, maxVariableFee, contractRate } = fees;
|
|
221
|
-
return {
|
|
222
|
-
flat: toAmount(flatFee),
|
|
223
|
-
variableRate: toRatio(variableRate),
|
|
224
|
-
maxVariable: toAmount(maxVariableFee),
|
|
225
|
-
contractRate: toRatio(contractRate),
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
/** @type {FastUSDCConfig} */
|
|
230
|
-
const config = harden({
|
|
231
|
-
oracles: parseOracleArgs(),
|
|
232
|
-
terms: {
|
|
233
|
-
usdcDenom,
|
|
234
|
-
},
|
|
235
|
-
feeConfig: parseFeeConfigArgs(),
|
|
236
|
-
feedPolicy: parseFeedPolicy(),
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
await writeCoreEval('start-fast-usdc', utils =>
|
|
240
|
-
defaultProposalBuilder(utils, config),
|
|
241
|
-
);
|
|
242
|
-
};
|
|
@@ -1,128 +0,0 @@
|
|
|
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 { makeTracer } from '@agoric/internal';
|
|
8
|
-
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
9
|
-
import { E } from '@endo/far';
|
|
10
|
-
import { deeplyFulfilled } from '@endo/marshal';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @import {AutoStakeItSF} from '@agoric/orchestration/src/examples/auto-stake-it.contract.js';
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const contractName = 'autoAutoStakeIt';
|
|
17
|
-
const trace = makeTracer(contractName, true);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param {BootstrapPowers} powers
|
|
21
|
-
*/
|
|
22
|
-
export const startAutoStakeIt = async ({
|
|
23
|
-
consume: {
|
|
24
|
-
agoricNames,
|
|
25
|
-
board,
|
|
26
|
-
chainStorage,
|
|
27
|
-
chainTimerService,
|
|
28
|
-
cosmosInterchainService,
|
|
29
|
-
localchain,
|
|
30
|
-
startUpgradable,
|
|
31
|
-
},
|
|
32
|
-
installation: {
|
|
33
|
-
// @ts-expect-error not a WellKnownName
|
|
34
|
-
consume: { [contractName]: installation },
|
|
35
|
-
},
|
|
36
|
-
instance: {
|
|
37
|
-
// @ts-expect-error not a WellKnownName
|
|
38
|
-
produce: { [contractName]: produceInstance },
|
|
39
|
-
},
|
|
40
|
-
}) => {
|
|
41
|
-
trace(`start ${contractName}`);
|
|
42
|
-
await null;
|
|
43
|
-
|
|
44
|
-
const storageNode = await makeStorageNodeChild(chainStorage, contractName);
|
|
45
|
-
const marshaller = await E(board).getPublishingMarshaller();
|
|
46
|
-
|
|
47
|
-
/** @type {StartUpgradableOpts<AutoStakeItSF>} */
|
|
48
|
-
const startOpts = {
|
|
49
|
-
label: 'autoAutoStakeIt',
|
|
50
|
-
installation,
|
|
51
|
-
terms: undefined,
|
|
52
|
-
privateArgs: await deeplyFulfilled(
|
|
53
|
-
// @ts-expect-error
|
|
54
|
-
harden({
|
|
55
|
-
agoricNames,
|
|
56
|
-
orchestrationService: cosmosInterchainService,
|
|
57
|
-
localchain,
|
|
58
|
-
storageNode,
|
|
59
|
-
marshaller,
|
|
60
|
-
timerService: chainTimerService,
|
|
61
|
-
}),
|
|
62
|
-
),
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const { instance } = await E(startUpgradable)(startOpts);
|
|
66
|
-
produceInstance.resolve(instance);
|
|
67
|
-
};
|
|
68
|
-
harden(startAutoStakeIt);
|
|
69
|
-
|
|
70
|
-
export const getManifestForContract = (
|
|
71
|
-
{ restoreRef },
|
|
72
|
-
{ installKeys, ...options },
|
|
73
|
-
) => {
|
|
74
|
-
return {
|
|
75
|
-
manifest: {
|
|
76
|
-
[startAutoStakeIt.name]: {
|
|
77
|
-
consume: {
|
|
78
|
-
agoricNames: true,
|
|
79
|
-
board: true,
|
|
80
|
-
chainStorage: true,
|
|
81
|
-
chainTimerService: true,
|
|
82
|
-
cosmosInterchainService: true,
|
|
83
|
-
localchain: true,
|
|
84
|
-
startUpgradable: true,
|
|
85
|
-
},
|
|
86
|
-
installation: {
|
|
87
|
-
consume: { [contractName]: true },
|
|
88
|
-
},
|
|
89
|
-
instance: {
|
|
90
|
-
produce: { [contractName]: true },
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
installations: {
|
|
95
|
-
[contractName]: restoreRef(installKeys[contractName]),
|
|
96
|
-
},
|
|
97
|
-
options,
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
102
|
-
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
103
|
-
return harden({
|
|
104
|
-
// Somewhat unorthodox, source the exports from this builder module
|
|
105
|
-
sourceSpec: '@agoric/builders/scripts/testing/start-auto-stake-it.js',
|
|
106
|
-
getManifestCall: [
|
|
107
|
-
'getManifestForContract',
|
|
108
|
-
{
|
|
109
|
-
installKeys: {
|
|
110
|
-
autoAutoStakeIt: publishRef(
|
|
111
|
-
install(
|
|
112
|
-
'@agoric/orchestration/src/examples/auto-stake-it.contract.js',
|
|
113
|
-
),
|
|
114
|
-
),
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
122
|
-
export default async (homeP, endowments) => {
|
|
123
|
-
// import dynamically so the module can work in CoreEval environment
|
|
124
|
-
const dspModule = await import('@agoric/deploy-script-support');
|
|
125
|
-
const { makeHelpers } = dspModule;
|
|
126
|
-
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
127
|
-
await writeCoreEval(startAutoStakeIt.name, defaultProposalBuilder);
|
|
128
|
-
};
|