@aztec/bot 0.0.1-commit.d431d1c → 0.0.1-commit.e310a4c8
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/dest/amm_bot.d.ts +3 -4
- package/dest/amm_bot.d.ts.map +1 -1
- package/dest/amm_bot.js +5 -1
- package/dest/base_bot.d.ts +3 -3
- package/dest/base_bot.d.ts.map +1 -1
- package/dest/base_bot.js +3 -3
- package/dest/bot.d.ts +3 -3
- package/dest/bot.d.ts.map +1 -1
- package/dest/bot.js +5 -2
- package/dest/factory.d.ts +1 -6
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +75 -52
- package/package.json +13 -13
- package/src/amm_bot.ts +4 -4
- package/src/base_bot.ts +4 -8
- package/src/bot.ts +4 -3
- package/src/factory.ts +54 -32
package/dest/amm_bot.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import {
|
|
3
|
-
import { TxReceipt } from '@aztec/aztec.js/tx';
|
|
2
|
+
import { TxHash, TxReceipt } from '@aztec/aztec.js/tx';
|
|
4
3
|
import type { AMMContract } from '@aztec/noir-contracts.js/AMM';
|
|
5
4
|
import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
6
5
|
import type { AztecNode, AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
@@ -18,7 +17,7 @@ export declare class AmmBot extends BaseBot {
|
|
|
18
17
|
readonly token1: TokenContract;
|
|
19
18
|
protected constructor(node: AztecNode, wallet: TestWallet, defaultAccountAddress: AztecAddress, amm: AMMContract, token0: TokenContract, token1: TokenContract, config: BotConfig);
|
|
20
19
|
static create(config: BotConfig, wallet: TestWallet, aztecNode: AztecNode, aztecNodeAdmin: AztecNodeAdmin | undefined, store: BotStore): Promise<AmmBot>;
|
|
21
|
-
protected createAndSendTx(logCtx: object): Promise<
|
|
20
|
+
protected createAndSendTx(logCtx: object): Promise<TxHash>;
|
|
22
21
|
protected onTxMined(receipt: TxReceipt, logCtx: object): Promise<void>;
|
|
23
22
|
getAmmBalances(): Promise<Balances>;
|
|
24
23
|
getBalances(): Promise<{
|
|
@@ -30,4 +29,4 @@ export declare class AmmBot extends BaseBot {
|
|
|
30
29
|
private getPrivateBalanceFor;
|
|
31
30
|
}
|
|
32
31
|
export {};
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW1tX2JvdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2FtbV9ib3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBR3pELE9BQU8sRUFBRSxNQUFNLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFdkQsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sOEJBQThCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLGNBQWMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pGLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBRTVELE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDeEMsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBRTdDLE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBS2pELEtBQUssUUFBUSxHQUFHO0lBQUUsTUFBTSxFQUFFLE1BQU0sQ0FBQztJQUFD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QjtDQU1uQyJ9
|
package/dest/amm_bot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amm_bot.d.ts","sourceRoot":"","sources":["../src/amm_bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"amm_bot.d.ts","sourceRoot":"","sources":["../src/amm_bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKjD,KAAK,QAAQ,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD,qBAAa,MAAO,SAAQ,OAAO;aAKf,GAAG,EAAE,WAAW;aAChB,MAAM,EAAE,aAAa;aACrB,MAAM,EAAE,aAAa;IANvC,SAAS,aACP,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,UAAU,EAClB,qBAAqB,EAAE,YAAY,EACnB,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrC,MAAM,EAAE,SAAS,EAGlB;IAED,OAAa,MAAM,CACjB,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,GAAG,SAAS,EAC1C,KAAK,EAAE,QAAQ,GACd,OAAO,CAAC,MAAM,CAAC,CASjB;IAED,UAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA0C/D;IAED,UAAyB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGpF;IAEM,cAAc,IAAI,OAAO,CAAC,QAAQ,CAAC,CAEzC;IAEY,WAAW,IAAI,OAAO,CAAC;QAAE,YAAY,EAAE,QAAQ,CAAC;QAAC,aAAa,EAAE,QAAQ,CAAC;QAAC,GAAG,EAAE,QAAQ,CAAA;KAAE,CAAC,CAMtG;YAEa,mBAAmB;YAMnB,oBAAoB;CAMnC"}
|
package/dest/amm_bot.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
1
2
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
2
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
4
|
import { BaseBot } from './base_bot.js';
|
|
@@ -55,7 +56,10 @@ export class AmmBot extends BaseBot {
|
|
|
55
56
|
...logCtx,
|
|
56
57
|
balances
|
|
57
58
|
});
|
|
58
|
-
return swapExactTokensInteraction.send(
|
|
59
|
+
return swapExactTokensInteraction.send({
|
|
60
|
+
...opts,
|
|
61
|
+
wait: NO_WAIT
|
|
62
|
+
});
|
|
59
63
|
}
|
|
60
64
|
async onTxMined(receipt, logCtx) {
|
|
61
65
|
const balances = await this.getBalances();
|
package/dest/base_bot.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { BatchCall, ContractFunctionInteraction, type SendInteractionOptions
|
|
2
|
+
import { BatchCall, ContractFunctionInteraction, type SendInteractionOptions } from '@aztec/aztec.js/contracts';
|
|
3
3
|
import { TxHash, TxReceipt } from '@aztec/aztec.js/tx';
|
|
4
4
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
@@ -14,8 +14,8 @@ export declare abstract class BaseBot {
|
|
|
14
14
|
protected successes: number;
|
|
15
15
|
protected constructor(node: AztecNode, wallet: TestWallet, defaultAccountAddress: AztecAddress, config: BotConfig);
|
|
16
16
|
run(): Promise<TxReceipt | TxHash>;
|
|
17
|
-
protected abstract createAndSendTx(logCtx: object): Promise<
|
|
17
|
+
protected abstract createAndSendTx(logCtx: object): Promise<TxHash>;
|
|
18
18
|
protected onTxMined(_receipt: TxReceipt, _logCtx: object): Promise<void>;
|
|
19
19
|
protected getSendMethodOpts(interaction: ContractFunctionInteraction | BatchCall): Promise<SendInteractionOptions>;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZV9ib3QuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9iYXNlX2JvdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDekQsT0FBTyxFQUNMLFNBQVMsRUFDVCwyQkFBMkIsRUFDM0IsS0FBSyxzQkFBc0IsRUFFNUIsTUFBTSwyQkFBMkIsQ0FBQztBQUduQyxPQUFPLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXZELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFB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nD,OAAO,CAAC,sBAAsB,CAAC,CAoBjC;CACF"}
|
package/dest/base_bot.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { waitForProven } from '@aztec/aztec.js/contracts';
|
|
2
2
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
3
|
+
import { waitForTx } from '@aztec/aztec.js/node';
|
|
3
4
|
import { Gas } from '@aztec/stdlib/gas';
|
|
4
5
|
export class BaseBot {
|
|
5
6
|
node;
|
|
@@ -25,14 +26,13 @@ export class BaseBot {
|
|
|
25
26
|
};
|
|
26
27
|
const { followChain, txMinedWaitSeconds } = this.config;
|
|
27
28
|
this.log.verbose(`Creating tx`, logCtx);
|
|
28
|
-
const
|
|
29
|
-
const txHash = await tx.getTxHash();
|
|
29
|
+
const txHash = await this.createAndSendTx(logCtx);
|
|
30
30
|
if (followChain === 'NONE') {
|
|
31
31
|
this.log.info(`Transaction ${txHash.toString()} sent, not waiting for it to be mined`);
|
|
32
32
|
return txHash;
|
|
33
33
|
}
|
|
34
34
|
this.log.verbose(`Awaiting tx ${txHash.toString()} to be on the ${followChain} chain (timeout ${txMinedWaitSeconds}s)`, logCtx);
|
|
35
|
-
const receipt = await
|
|
35
|
+
const receipt = await waitForTx(this.node, txHash, {
|
|
36
36
|
timeout: txMinedWaitSeconds
|
|
37
37
|
});
|
|
38
38
|
if (followChain === 'PROVEN') {
|
package/dest/bot.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import {
|
|
2
|
+
import { TxHash } from '@aztec/aztec.js/tx';
|
|
3
3
|
import type { PrivateTokenContract } from '@aztec/noir-contracts.js/PrivateToken';
|
|
4
4
|
import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
5
|
import type { AztecNode, AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
@@ -13,7 +13,7 @@ export declare class Bot extends BaseBot {
|
|
|
13
13
|
protected constructor(node: AztecNode, wallet: TestWallet, defaultAccountAddress: AztecAddress, token: TokenContract | PrivateTokenContract, recipient: AztecAddress, config: BotConfig);
|
|
14
14
|
static create(config: BotConfig, wallet: TestWallet, aztecNode: AztecNode, aztecNodeAdmin: AztecNodeAdmin | undefined, store: BotStore): Promise<Bot>;
|
|
15
15
|
updateConfig(config: Partial<BotConfig>): void;
|
|
16
|
-
protected createAndSendTx(logCtx: object): Promise<
|
|
16
|
+
protected createAndSendTx(logCtx: object): Promise<TxHash>;
|
|
17
17
|
getBalances(): Promise<{
|
|
18
18
|
sender: {
|
|
19
19
|
privateBalance: bigint;
|
|
@@ -25,4 +25,4 @@ export declare class Bot extends BaseBot {
|
|
|
25
25
|
};
|
|
26
26
|
}>;
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm90LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvYm90LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBRTlELE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUU1QyxPQUFPLEtBQUssRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHVDQUF1QyxDQUFDO0FBQ2xGLE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxjQUFjLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRixPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUU1RCxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sZUFBZSxDQUF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
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BatchCall } from '@aztec/aztec.js/contracts';
|
|
1
|
+
import { BatchCall, NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
2
2
|
import { times } from '@aztec/foundation/collection';
|
|
3
3
|
import { BaseBot } from './base_bot.js';
|
|
4
4
|
import { BotFactory } from './factory.js';
|
|
@@ -36,7 +36,10 @@ export class Bot extends BaseBot {
|
|
|
36
36
|
from: this.defaultAccountAddress
|
|
37
37
|
});
|
|
38
38
|
this.log.verbose(`Sending transaction`, logCtx);
|
|
39
|
-
return batch.send(
|
|
39
|
+
return batch.send({
|
|
40
|
+
...opts,
|
|
41
|
+
wait: NO_WAIT
|
|
42
|
+
});
|
|
40
43
|
}
|
|
41
44
|
async getBalances() {
|
|
42
45
|
if (isStandardTokenContract(this.token)) {
|
package/dest/factory.d.ts
CHANGED
|
@@ -37,11 +37,6 @@ export declare class BotFactory {
|
|
|
37
37
|
private setupAccountWithPrivateKey;
|
|
38
38
|
private setupTestAccount;
|
|
39
39
|
private setupToken;
|
|
40
|
-
/**
|
|
41
|
-
* Checks if the token contract is deployed and deploys it if necessary.
|
|
42
|
-
* @param wallet - Wallet to deploy the token contract from.
|
|
43
|
-
* @returns The TokenContract instance.
|
|
44
|
-
*/
|
|
45
40
|
private setupTokenContract;
|
|
46
41
|
private setupAmmContract;
|
|
47
42
|
private fundAmm;
|
|
@@ -51,4 +46,4 @@ export declare class BotFactory {
|
|
|
51
46
|
private bridgeL1FeeJuice;
|
|
52
47
|
private withNoMinTxsPerBlock;
|
|
53
48
|
}
|
|
54
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2ZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyx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ssRUFBRSxhQUFhLEdBQUcsb0JBQW9CLENBQUM7UUFDNUMsSUFBSSxFQUFFLFNBQVMsQ0FBQztRQUNoQixTQUFTLEVBQUUsWUFBWSxDQUFDO0tBQ3pCLENBQUMsQ0FNRDtJQUVZLFFBQVEsSUFBSSxPQUFPLENBQUM7UUFDL0IsTUFBTSxFQUFFLFVBQVUsQ0FBQztRQUNuQixxQkFBcUIsRUFBRSxZQUFZLENBQUM7UUFDcEMsR0FBRyxFQUFFLFdBQVcsQ0FBQztRQUNqQixNQUFNLEVBQUUsYUFBYSxDQUFDO1FBQ3RCLE1BQU0sRUFBRSxhQUFhLENBQUM7UUFDdEIsSUFBSSxFQUFFLFNBQVMsQ0FBQztLQUNqQixDQUFDLENBc0JEO1lBTWEsWUFBWTtZQVdaLDBCQUEwQjtZQThDMUIsZ0JBQWdCO1lBZ0JoQixVQUFVO1lBb0RWLGtCQUFrQjtZQWFsQixnQkFBZ0I7WUFzQmhCLE9BQU87WUE2RVAsd0JBQXdCO1lBMEJ4QixVQUFVO1lBMENWLHNCQUFzQjtZQTRCdEIsZ0JBQWdCO1lBZ0NoQixvQkFBb0I7Q0FlbkMifQ==
|
package/dest/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAoBzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,M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/factory.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
3
3
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
4
|
-
import { BatchCall } from '@aztec/aztec.js/contracts';
|
|
4
|
+
import { BatchCall, NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
5
5
|
import { L1FeeJuicePortalManager } from '@aztec/aztec.js/ethereum';
|
|
6
6
|
import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
7
7
|
import { deriveKeys } from '@aztec/aztec.js/keys';
|
|
8
8
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
9
9
|
import { waitForL1ToL2MessageReady } from '@aztec/aztec.js/messaging';
|
|
10
|
+
import { waitForTx } from '@aztec/aztec.js/node';
|
|
10
11
|
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
11
12
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
12
13
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
@@ -108,18 +109,20 @@ export class BotFactory {
|
|
|
108
109
|
const gasSettings = GasSettings.default({
|
|
109
110
|
maxFeesPerGas
|
|
110
111
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
await this.withNoMinTxsPerBlock(async ()=>{
|
|
113
|
+
const txHash = await deployMethod.send({
|
|
114
|
+
from: AztecAddress.ZERO,
|
|
115
|
+
fee: {
|
|
116
|
+
gasSettings,
|
|
117
|
+
paymentMethod
|
|
118
|
+
},
|
|
119
|
+
wait: NO_WAIT
|
|
120
|
+
});
|
|
121
|
+
this.log.info(`Sent tx for account deployment with hash ${txHash.toString()}`);
|
|
122
|
+
return waitForTx(this.aztecNode, txHash, {
|
|
121
123
|
timeout: this.config.txMinedWaitSeconds
|
|
122
|
-
})
|
|
124
|
+
});
|
|
125
|
+
});
|
|
123
126
|
this.log.info(`Account deployed at ${address}`);
|
|
124
127
|
// Clean up the consumed bridge claim
|
|
125
128
|
await this.store.deleteBridgeClaim(address);
|
|
@@ -148,8 +151,11 @@ export class BotFactory {
|
|
|
148
151
|
contractAddressSalt: this.config.tokenSalt,
|
|
149
152
|
universalDeploy: true
|
|
150
153
|
};
|
|
154
|
+
let token;
|
|
151
155
|
if (this.config.contract === SupportedTokenContracts.TokenContract) {
|
|
152
156
|
deploy = TokenContract.deploy(this.wallet, sender, 'BotToken', 'BOT', 18);
|
|
157
|
+
tokenInstance = await deploy.getInstance(deployOpts);
|
|
158
|
+
token = TokenContract.at(tokenInstance.address, this.wallet);
|
|
153
159
|
} else if (this.config.contract === SupportedTokenContracts.PrivateTokenContract) {
|
|
154
160
|
// Generate keys for the contract since PrivateToken uses SinglePrivateMutable which requires keys
|
|
155
161
|
const tokenSecretKey = Fr.random();
|
|
@@ -160,6 +166,7 @@ export class BotFactory {
|
|
|
160
166
|
deployOpts.skipInitialization = false;
|
|
161
167
|
// Register the contract with the secret key before deployment
|
|
162
168
|
tokenInstance = await deploy.getInstance(deployOpts);
|
|
169
|
+
token = PrivateTokenContract.at(tokenInstance.address, this.wallet);
|
|
163
170
|
await this.wallet.registerContract(tokenInstance, PrivateTokenContract.artifact, tokenSecretKey);
|
|
164
171
|
} else {
|
|
165
172
|
throw new Error(`Unsupported token contract type: ${this.config.contract}`);
|
|
@@ -168,29 +175,36 @@ export class BotFactory {
|
|
|
168
175
|
const metadata = await this.wallet.getContractMetadata(address);
|
|
169
176
|
if (metadata.isContractPublished) {
|
|
170
177
|
this.log.info(`Token at ${address.toString()} already deployed`);
|
|
171
|
-
|
|
178
|
+
await deploy.register();
|
|
172
179
|
} else {
|
|
173
180
|
this.log.info(`Deploying token contract at ${address.toString()}`);
|
|
174
|
-
const
|
|
175
|
-
|
|
181
|
+
const txHash = await deploy.send({
|
|
182
|
+
...deployOpts,
|
|
183
|
+
wait: NO_WAIT
|
|
184
|
+
});
|
|
176
185
|
this.log.info(`Sent tx for token setup with hash ${txHash.toString()}`);
|
|
177
|
-
|
|
186
|
+
await this.withNoMinTxsPerBlock(async ()=>{
|
|
187
|
+
await waitForTx(this.aztecNode, txHash, {
|
|
178
188
|
timeout: this.config.txMinedWaitSeconds
|
|
179
|
-
})
|
|
189
|
+
});
|
|
190
|
+
return token;
|
|
191
|
+
});
|
|
180
192
|
}
|
|
193
|
+
return token;
|
|
181
194
|
}
|
|
182
195
|
/**
|
|
183
196
|
* Checks if the token contract is deployed and deploys it if necessary.
|
|
184
197
|
* @param wallet - Wallet to deploy the token contract from.
|
|
185
198
|
* @returns The TokenContract instance.
|
|
186
|
-
*/ setupTokenContract(deployer, contractAddressSalt, name, ticker, decimals = 18) {
|
|
199
|
+
*/ async setupTokenContract(deployer, contractAddressSalt, name, ticker, decimals = 18) {
|
|
187
200
|
const deployOpts = {
|
|
188
201
|
from: deployer,
|
|
189
202
|
contractAddressSalt,
|
|
190
203
|
universalDeploy: true
|
|
191
204
|
};
|
|
192
205
|
const deploy = TokenContract.deploy(this.wallet, deployer, name, ticker, decimals);
|
|
193
|
-
|
|
206
|
+
const instance = await this.registerOrDeployContract('Token - ' + name, deploy, deployOpts);
|
|
207
|
+
return TokenContract.at(instance.address, this.wallet);
|
|
194
208
|
}
|
|
195
209
|
async setupAmmContract(deployer, contractAddressSalt, token0, token1, lpToken) {
|
|
196
210
|
const deployOpts = {
|
|
@@ -199,15 +213,16 @@ export class BotFactory {
|
|
|
199
213
|
universalDeploy: true
|
|
200
214
|
};
|
|
201
215
|
const deploy = AMMContract.deploy(this.wallet, token0.address, token1.address, lpToken.address);
|
|
202
|
-
const
|
|
216
|
+
const instance = await this.registerOrDeployContract('AMM', deploy, deployOpts);
|
|
217
|
+
const amm = AMMContract.at(instance.address, this.wallet);
|
|
203
218
|
this.log.info(`AMM deployed at ${amm.address}`);
|
|
204
|
-
const
|
|
205
|
-
from: deployer
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
timeout: this.config.txMinedWaitSeconds
|
|
219
|
+
const minterReceipt = await lpToken.methods.set_minter(amm.address, true).send({
|
|
220
|
+
from: deployer,
|
|
221
|
+
wait: {
|
|
222
|
+
timeout: this.config.txMinedWaitSeconds
|
|
223
|
+
}
|
|
210
224
|
});
|
|
225
|
+
this.log.info(`Set LP token minter to AMM txHash=${minterReceipt.txHash.toString()}`);
|
|
211
226
|
this.log.info(`Liquidity token initialized`);
|
|
212
227
|
return amm;
|
|
213
228
|
}
|
|
@@ -240,46 +255,52 @@ export class BotFactory {
|
|
|
240
255
|
caller: amm.address,
|
|
241
256
|
call: await token1.methods.transfer_to_public_and_prepare_private_balance_increase(liquidityProvider, amm.address, amount1Max, authwitNonce).getFunctionCall()
|
|
242
257
|
});
|
|
243
|
-
const
|
|
258
|
+
const mintReceipt = await new BatchCall(this.wallet, [
|
|
244
259
|
token0.methods.mint_to_private(liquidityProvider, MINT_BALANCE),
|
|
245
260
|
token1.methods.mint_to_private(liquidityProvider, MINT_BALANCE)
|
|
246
261
|
]).send({
|
|
247
|
-
from: liquidityProvider
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
timeout: this.config.txMinedWaitSeconds
|
|
262
|
+
from: liquidityProvider,
|
|
263
|
+
wait: {
|
|
264
|
+
timeout: this.config.txMinedWaitSeconds
|
|
265
|
+
}
|
|
252
266
|
});
|
|
253
|
-
|
|
267
|
+
this.log.info(`Sent mint tx: ${mintReceipt.txHash.toString()}`);
|
|
268
|
+
const addLiquidityReceipt = await amm.methods.add_liquidity(amount0Max, amount1Max, amount0Min, amount1Min, authwitNonce).send({
|
|
254
269
|
from: liquidityProvider,
|
|
255
270
|
authWitnesses: [
|
|
256
271
|
token0Authwit,
|
|
257
272
|
token1Authwit
|
|
258
|
-
]
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
timeout: this.config.txMinedWaitSeconds
|
|
273
|
+
],
|
|
274
|
+
wait: {
|
|
275
|
+
timeout: this.config.txMinedWaitSeconds
|
|
276
|
+
}
|
|
263
277
|
});
|
|
278
|
+
this.log.info(`Sent tx to add liquidity to the AMM: ${addLiquidityReceipt.txHash.toString()}`);
|
|
264
279
|
this.log.info(`Liquidity added`);
|
|
265
280
|
const [newT0Bal, newT1Bal, newLPBal] = await getPrivateBalances();
|
|
266
281
|
this.log.info(`Updated private balances of ${defaultAccountAddress} after minting and funding AMM: token0=${newT0Bal}, token1=${newT1Bal}, lp=${newLPBal}`);
|
|
267
282
|
}
|
|
268
283
|
async registerOrDeployContract(name, deploy, deployOpts) {
|
|
269
|
-
const
|
|
284
|
+
const instance = await deploy.getInstance(deployOpts);
|
|
285
|
+
const address = instance.address;
|
|
270
286
|
const metadata = await this.wallet.getContractMetadata(address);
|
|
271
287
|
if (metadata.isContractPublished) {
|
|
272
288
|
this.log.info(`Contract ${name} at ${address.toString()} already deployed`);
|
|
273
|
-
|
|
289
|
+
await deploy.register();
|
|
274
290
|
} else {
|
|
275
291
|
this.log.info(`Deploying contract ${name} at ${address.toString()}`);
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
292
|
+
await this.withNoMinTxsPerBlock(async ()=>{
|
|
293
|
+
const txHash = await deploy.send({
|
|
294
|
+
...deployOpts,
|
|
295
|
+
wait: NO_WAIT
|
|
296
|
+
});
|
|
297
|
+
this.log.info(`Sent contract ${name} setup tx with hash ${txHash.toString()}`);
|
|
298
|
+
return waitForTx(this.aztecNode, txHash, {
|
|
280
299
|
timeout: this.config.txMinedWaitSeconds
|
|
281
|
-
})
|
|
300
|
+
});
|
|
301
|
+
});
|
|
282
302
|
}
|
|
303
|
+
return instance;
|
|
283
304
|
}
|
|
284
305
|
/**
|
|
285
306
|
* Mints private and public tokens for the sender if their balance is below the minimum.
|
|
@@ -306,14 +327,16 @@ export class BotFactory {
|
|
|
306
327
|
this.log.info(`Skipping minting as ${minter.toString()} has enough tokens`);
|
|
307
328
|
return;
|
|
308
329
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
330
|
+
await this.withNoMinTxsPerBlock(async ()=>{
|
|
331
|
+
const txHash = await new BatchCall(token.wallet, calls).send({
|
|
332
|
+
from: minter,
|
|
333
|
+
wait: NO_WAIT
|
|
334
|
+
});
|
|
335
|
+
this.log.info(`Sent token mint tx with hash ${txHash.toString()}`);
|
|
336
|
+
return waitForTx(this.aztecNode, txHash, {
|
|
315
337
|
timeout: this.config.txMinedWaitSeconds
|
|
316
|
-
})
|
|
338
|
+
});
|
|
339
|
+
});
|
|
317
340
|
}
|
|
318
341
|
/**
|
|
319
342
|
* Gets or creates a bridge claim for the recipient.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/bot",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.e310a4c8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -54,18 +54,18 @@
|
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
58
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
59
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
60
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
61
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
62
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
63
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
64
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
65
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
66
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
67
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
68
|
-
"@aztec/test-wallet": "0.0.1-commit.
|
|
57
|
+
"@aztec/accounts": "0.0.1-commit.e310a4c8",
|
|
58
|
+
"@aztec/aztec.js": "0.0.1-commit.e310a4c8",
|
|
59
|
+
"@aztec/entrypoints": "0.0.1-commit.e310a4c8",
|
|
60
|
+
"@aztec/ethereum": "0.0.1-commit.e310a4c8",
|
|
61
|
+
"@aztec/foundation": "0.0.1-commit.e310a4c8",
|
|
62
|
+
"@aztec/kv-store": "0.0.1-commit.e310a4c8",
|
|
63
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.e310a4c8",
|
|
64
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.e310a4c8",
|
|
65
|
+
"@aztec/protocol-contracts": "0.0.1-commit.e310a4c8",
|
|
66
|
+
"@aztec/stdlib": "0.0.1-commit.e310a4c8",
|
|
67
|
+
"@aztec/telemetry-client": "0.0.1-commit.e310a4c8",
|
|
68
|
+
"@aztec/test-wallet": "0.0.1-commit.e310a4c8",
|
|
69
69
|
"source-map-support": "^0.5.21",
|
|
70
70
|
"tslib": "^2.4.0",
|
|
71
71
|
"zod": "^3.23.8"
|
package/src/amm_bot.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import {
|
|
2
|
+
import { NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
3
3
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
-
import { TxReceipt } from '@aztec/aztec.js/tx';
|
|
4
|
+
import { TxHash, TxReceipt } from '@aztec/aztec.js/tx';
|
|
5
5
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
6
6
|
import type { AMMContract } from '@aztec/noir-contracts.js/AMM';
|
|
7
7
|
import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
@@ -48,7 +48,7 @@ export class AmmBot extends BaseBot {
|
|
|
48
48
|
return new AmmBot(aztecNode, wallet, defaultAccountAddress, amm, token0, token1, config);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
protected async createAndSendTx(logCtx: object): Promise<
|
|
51
|
+
protected async createAndSendTx(logCtx: object): Promise<TxHash> {
|
|
52
52
|
const { feePaymentMethod } = this.config;
|
|
53
53
|
const { wallet, amm, token0, token1 } = this;
|
|
54
54
|
|
|
@@ -89,7 +89,7 @@ export class AmmBot extends BaseBot {
|
|
|
89
89
|
|
|
90
90
|
this.log.verbose(`Sending transaction`, logCtx);
|
|
91
91
|
this.log.info(`Tx. Balances: ${jsonStringify(balances)}`, { ...logCtx, balances });
|
|
92
|
-
return swapExactTokensInteraction.send(opts);
|
|
92
|
+
return swapExactTokensInteraction.send({ ...opts, wait: NO_WAIT });
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
protected override async onTxMined(receipt: TxReceipt, logCtx: object): Promise<void> {
|
package/src/base_bot.ts
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
BatchCall,
|
|
4
4
|
ContractFunctionInteraction,
|
|
5
5
|
type SendInteractionOptions,
|
|
6
|
-
SentTx,
|
|
7
6
|
waitForProven,
|
|
8
7
|
} from '@aztec/aztec.js/contracts';
|
|
9
8
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
9
|
+
import { waitForTx } from '@aztec/aztec.js/node';
|
|
10
10
|
import { TxHash, TxReceipt } from '@aztec/aztec.js/tx';
|
|
11
11
|
import { Gas } from '@aztec/stdlib/gas';
|
|
12
12
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
@@ -33,9 +33,7 @@ export abstract class BaseBot {
|
|
|
33
33
|
const { followChain, txMinedWaitSeconds } = this.config;
|
|
34
34
|
|
|
35
35
|
this.log.verbose(`Creating tx`, logCtx);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const txHash = await tx.getTxHash();
|
|
36
|
+
const txHash = await this.createAndSendTx(logCtx);
|
|
39
37
|
|
|
40
38
|
if (followChain === 'NONE') {
|
|
41
39
|
this.log.info(`Transaction ${txHash.toString()} sent, not waiting for it to be mined`);
|
|
@@ -46,9 +44,7 @@ export abstract class BaseBot {
|
|
|
46
44
|
`Awaiting tx ${txHash.toString()} to be on the ${followChain} chain (timeout ${txMinedWaitSeconds}s)`,
|
|
47
45
|
logCtx,
|
|
48
46
|
);
|
|
49
|
-
const receipt = await
|
|
50
|
-
timeout: txMinedWaitSeconds,
|
|
51
|
-
});
|
|
47
|
+
const receipt = await waitForTx(this.node, txHash, { timeout: txMinedWaitSeconds });
|
|
52
48
|
if (followChain === 'PROVEN') {
|
|
53
49
|
await waitForProven(this.node, receipt, { provenTimeout: txMinedWaitSeconds });
|
|
54
50
|
}
|
|
@@ -63,7 +59,7 @@ export abstract class BaseBot {
|
|
|
63
59
|
return receipt;
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
protected abstract createAndSendTx(logCtx: object): Promise<
|
|
62
|
+
protected abstract createAndSendTx(logCtx: object): Promise<TxHash>;
|
|
67
63
|
|
|
68
64
|
protected onTxMined(_receipt: TxReceipt, _logCtx: object): Promise<void> {
|
|
69
65
|
// no-op
|
package/src/bot.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { BatchCall,
|
|
2
|
+
import { BatchCall, NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
3
|
+
import { TxHash } from '@aztec/aztec.js/tx';
|
|
3
4
|
import { times } from '@aztec/foundation/collection';
|
|
4
5
|
import type { PrivateTokenContract } from '@aztec/noir-contracts.js/PrivateToken';
|
|
5
6
|
import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
@@ -48,7 +49,7 @@ export class Bot extends BaseBot {
|
|
|
48
49
|
this.config = { ...this.config, ...config };
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
protected async createAndSendTx(logCtx: object): Promise<
|
|
52
|
+
protected async createAndSendTx(logCtx: object): Promise<TxHash> {
|
|
52
53
|
const { privateTransfersPerTx, publicTransfersPerTx, feePaymentMethod } = this.config;
|
|
53
54
|
const { token, recipient, wallet } = this;
|
|
54
55
|
|
|
@@ -75,7 +76,7 @@ export class Bot extends BaseBot {
|
|
|
75
76
|
await batch.simulate({ from: this.defaultAccountAddress });
|
|
76
77
|
|
|
77
78
|
this.log.verbose(`Sending transaction`, logCtx);
|
|
78
|
-
return batch.send(opts);
|
|
79
|
+
return batch.send({ ...opts, wait: NO_WAIT });
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
public async getBalances() {
|
package/src/factory.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ContractFunctionInteraction,
|
|
8
8
|
type DeployMethod,
|
|
9
9
|
type DeployOptions,
|
|
10
|
+
NO_WAIT,
|
|
10
11
|
} from '@aztec/aztec.js/contracts';
|
|
11
12
|
import { L1FeeJuicePortalManager } from '@aztec/aztec.js/ethereum';
|
|
12
13
|
import type { L2AmountClaim } from '@aztec/aztec.js/ethereum';
|
|
@@ -14,6 +15,7 @@ import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
|
14
15
|
import { deriveKeys } from '@aztec/aztec.js/keys';
|
|
15
16
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
16
17
|
import { waitForL1ToL2MessageReady } from '@aztec/aztec.js/messaging';
|
|
18
|
+
import { waitForTx } from '@aztec/aztec.js/node';
|
|
17
19
|
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
18
20
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
19
21
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
@@ -136,10 +138,16 @@ export class BotFactory {
|
|
|
136
138
|
const deployMethod = await accountManager.getDeployMethod();
|
|
137
139
|
const maxFeesPerGas = (await this.aztecNode.getCurrentMinFees()).mul(1 + this.config.minFeePadding);
|
|
138
140
|
const gasSettings = GasSettings.default({ maxFeesPerGas });
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
|
|
142
|
+
await this.withNoMinTxsPerBlock(async () => {
|
|
143
|
+
const txHash = await deployMethod.send({
|
|
144
|
+
from: AztecAddress.ZERO,
|
|
145
|
+
fee: { gasSettings, paymentMethod },
|
|
146
|
+
wait: NO_WAIT,
|
|
147
|
+
});
|
|
148
|
+
this.log.info(`Sent tx for account deployment with hash ${txHash.toString()}`);
|
|
149
|
+
return waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds });
|
|
150
|
+
});
|
|
143
151
|
this.log.info(`Account deployed at ${address}`);
|
|
144
152
|
|
|
145
153
|
// Clean up the consumed bridge claim
|
|
@@ -173,8 +181,11 @@ export class BotFactory {
|
|
|
173
181
|
contractAddressSalt: this.config.tokenSalt,
|
|
174
182
|
universalDeploy: true,
|
|
175
183
|
};
|
|
184
|
+
let token: TokenContract | PrivateTokenContract;
|
|
176
185
|
if (this.config.contract === SupportedTokenContracts.TokenContract) {
|
|
177
186
|
deploy = TokenContract.deploy(this.wallet, sender, 'BotToken', 'BOT', 18);
|
|
187
|
+
tokenInstance = await deploy.getInstance(deployOpts);
|
|
188
|
+
token = TokenContract.at(tokenInstance.address, this.wallet);
|
|
178
189
|
} else if (this.config.contract === SupportedTokenContracts.PrivateTokenContract) {
|
|
179
190
|
// Generate keys for the contract since PrivateToken uses SinglePrivateMutable which requires keys
|
|
180
191
|
const tokenSecretKey = Fr.random();
|
|
@@ -186,6 +197,7 @@ export class BotFactory {
|
|
|
186
197
|
|
|
187
198
|
// Register the contract with the secret key before deployment
|
|
188
199
|
tokenInstance = await deploy.getInstance(deployOpts);
|
|
200
|
+
token = PrivateTokenContract.at(tokenInstance.address, this.wallet);
|
|
189
201
|
await this.wallet.registerContract(tokenInstance, PrivateTokenContract.artifact, tokenSecretKey);
|
|
190
202
|
} else {
|
|
191
203
|
throw new Error(`Unsupported token contract type: ${this.config.contract}`);
|
|
@@ -195,14 +207,17 @@ export class BotFactory {
|
|
|
195
207
|
const metadata = await this.wallet.getContractMetadata(address);
|
|
196
208
|
if (metadata.isContractPublished) {
|
|
197
209
|
this.log.info(`Token at ${address.toString()} already deployed`);
|
|
198
|
-
|
|
210
|
+
await deploy.register();
|
|
199
211
|
} else {
|
|
200
212
|
this.log.info(`Deploying token contract at ${address.toString()}`);
|
|
201
|
-
const
|
|
202
|
-
const txHash = await sentTx.getTxHash();
|
|
213
|
+
const txHash = await deploy.send({ ...deployOpts, wait: NO_WAIT });
|
|
203
214
|
this.log.info(`Sent tx for token setup with hash ${txHash.toString()}`);
|
|
204
|
-
|
|
215
|
+
await this.withNoMinTxsPerBlock(async () => {
|
|
216
|
+
await waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds });
|
|
217
|
+
return token;
|
|
218
|
+
});
|
|
205
219
|
}
|
|
220
|
+
return token;
|
|
206
221
|
}
|
|
207
222
|
|
|
208
223
|
/**
|
|
@@ -210,7 +225,7 @@ export class BotFactory {
|
|
|
210
225
|
* @param wallet - Wallet to deploy the token contract from.
|
|
211
226
|
* @returns The TokenContract instance.
|
|
212
227
|
*/
|
|
213
|
-
private setupTokenContract(
|
|
228
|
+
private async setupTokenContract(
|
|
214
229
|
deployer: AztecAddress,
|
|
215
230
|
contractAddressSalt: Fr,
|
|
216
231
|
name: string,
|
|
@@ -219,7 +234,8 @@ export class BotFactory {
|
|
|
219
234
|
): Promise<TokenContract> {
|
|
220
235
|
const deployOpts: DeployOptions = { from: deployer, contractAddressSalt, universalDeploy: true };
|
|
221
236
|
const deploy = TokenContract.deploy(this.wallet, deployer, name, ticker, decimals);
|
|
222
|
-
|
|
237
|
+
const instance = await this.registerOrDeployContract('Token - ' + name, deploy, deployOpts);
|
|
238
|
+
return TokenContract.at(instance.address, this.wallet);
|
|
223
239
|
}
|
|
224
240
|
|
|
225
241
|
private async setupAmmContract(
|
|
@@ -231,12 +247,14 @@ export class BotFactory {
|
|
|
231
247
|
): Promise<AMMContract> {
|
|
232
248
|
const deployOpts: DeployOptions = { from: deployer, contractAddressSalt, universalDeploy: true };
|
|
233
249
|
const deploy = AMMContract.deploy(this.wallet, token0.address, token1.address, lpToken.address);
|
|
234
|
-
const
|
|
250
|
+
const instance = await this.registerOrDeployContract('AMM', deploy, deployOpts);
|
|
251
|
+
const amm = AMMContract.at(instance.address, this.wallet);
|
|
235
252
|
|
|
236
253
|
this.log.info(`AMM deployed at ${amm.address}`);
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
254
|
+
const minterReceipt = await lpToken.methods
|
|
255
|
+
.set_minter(amm.address, true)
|
|
256
|
+
.send({ from: deployer, wait: { timeout: this.config.txMinedWaitSeconds } });
|
|
257
|
+
this.log.info(`Set LP token minter to AMM txHash=${minterReceipt.txHash.toString()}`);
|
|
240
258
|
this.log.info(`Liquidity token initialized`);
|
|
241
259
|
|
|
242
260
|
return amm;
|
|
@@ -295,23 +313,22 @@ export class BotFactory {
|
|
|
295
313
|
.getFunctionCall(),
|
|
296
314
|
});
|
|
297
315
|
|
|
298
|
-
const
|
|
316
|
+
const mintReceipt = await new BatchCall(this.wallet, [
|
|
299
317
|
token0.methods.mint_to_private(liquidityProvider, MINT_BALANCE),
|
|
300
318
|
token1.methods.mint_to_private(liquidityProvider, MINT_BALANCE),
|
|
301
|
-
]).send({ from: liquidityProvider });
|
|
319
|
+
]).send({ from: liquidityProvider, wait: { timeout: this.config.txMinedWaitSeconds } });
|
|
302
320
|
|
|
303
|
-
this.log.info(`Sent mint tx: ${
|
|
304
|
-
await mintTx.wait({ timeout: this.config.txMinedWaitSeconds });
|
|
321
|
+
this.log.info(`Sent mint tx: ${mintReceipt.txHash.toString()}`);
|
|
305
322
|
|
|
306
|
-
const
|
|
323
|
+
const addLiquidityReceipt = await amm.methods
|
|
307
324
|
.add_liquidity(amount0Max, amount1Max, amount0Min, amount1Min, authwitNonce)
|
|
308
325
|
.send({
|
|
309
326
|
from: liquidityProvider,
|
|
310
327
|
authWitnesses: [token0Authwit, token1Authwit],
|
|
328
|
+
wait: { timeout: this.config.txMinedWaitSeconds },
|
|
311
329
|
});
|
|
312
330
|
|
|
313
|
-
this.log.info(`Sent tx to add liquidity to the AMM: ${
|
|
314
|
-
await addLiquidityTx.wait({ timeout: this.config.txMinedWaitSeconds });
|
|
331
|
+
this.log.info(`Sent tx to add liquidity to the AMM: ${addLiquidityReceipt.txHash.toString()}`);
|
|
315
332
|
this.log.info(`Liquidity added`);
|
|
316
333
|
|
|
317
334
|
const [newT0Bal, newT1Bal, newLPBal] = await getPrivateBalances();
|
|
@@ -324,19 +341,22 @@ export class BotFactory {
|
|
|
324
341
|
name: string,
|
|
325
342
|
deploy: DeployMethod<T>,
|
|
326
343
|
deployOpts: DeployOptions,
|
|
327
|
-
): Promise<
|
|
328
|
-
const
|
|
344
|
+
): Promise<ContractInstanceWithAddress> {
|
|
345
|
+
const instance = await deploy.getInstance(deployOpts);
|
|
346
|
+
const address = instance.address;
|
|
329
347
|
const metadata = await this.wallet.getContractMetadata(address);
|
|
330
348
|
if (metadata.isContractPublished) {
|
|
331
349
|
this.log.info(`Contract ${name} at ${address.toString()} already deployed`);
|
|
332
|
-
|
|
350
|
+
await deploy.register();
|
|
333
351
|
} else {
|
|
334
352
|
this.log.info(`Deploying contract ${name} at ${address.toString()}`);
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
353
|
+
await this.withNoMinTxsPerBlock(async () => {
|
|
354
|
+
const txHash = await deploy.send({ ...deployOpts, wait: NO_WAIT });
|
|
355
|
+
this.log.info(`Sent contract ${name} setup tx with hash ${txHash.toString()}`);
|
|
356
|
+
return waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds });
|
|
357
|
+
});
|
|
339
358
|
}
|
|
359
|
+
return instance;
|
|
340
360
|
}
|
|
341
361
|
|
|
342
362
|
/**
|
|
@@ -372,10 +392,12 @@ export class BotFactory {
|
|
|
372
392
|
this.log.info(`Skipping minting as ${minter.toString()} has enough tokens`);
|
|
373
393
|
return;
|
|
374
394
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
395
|
+
|
|
396
|
+
await this.withNoMinTxsPerBlock(async () => {
|
|
397
|
+
const txHash = await new BatchCall(token.wallet, calls).send({ from: minter, wait: NO_WAIT });
|
|
398
|
+
this.log.info(`Sent token mint tx with hash ${txHash.toString()}`);
|
|
399
|
+
return waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds });
|
|
400
|
+
});
|
|
379
401
|
}
|
|
380
402
|
|
|
381
403
|
/**
|