@aztec/bot 0.0.1-commit.9ee6fcc6 → 0.0.1-commit.9ef841308
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.js +1 -1
- package/dest/base_bot.d.ts +3 -3
- package/dest/base_bot.d.ts.map +1 -1
- package/dest/base_bot.js +12 -22
- package/dest/bot.d.ts +1 -1
- package/dest/bot.d.ts.map +1 -1
- package/dest/bot.js +1 -5
- package/dest/config.d.ts +3 -3
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +2 -2
- package/dest/cross_chain_bot.js +1 -1
- package/dest/factory.d.ts +1 -1
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +11 -98
- package/package.json +15 -15
- package/src/amm_bot.ts +1 -1
- package/src/base_bot.ts +8 -16
- package/src/bot.ts +1 -4
- package/src/config.ts +4 -4
- package/src/cross_chain_bot.ts +1 -1
- package/src/factory.ts +14 -44
package/dest/amm_bot.js
CHANGED
|
@@ -52,7 +52,7 @@ export class AmmBot extends BaseBot {
|
|
|
52
52
|
swapAuthwit
|
|
53
53
|
]
|
|
54
54
|
});
|
|
55
|
-
const opts =
|
|
55
|
+
const opts = this.getSendMethodOpts();
|
|
56
56
|
this.log.verbose(`Sending transaction`, logCtx);
|
|
57
57
|
this.log.info(`Tx. Balances: ${jsonStringify(balances)}`, {
|
|
58
58
|
...logCtx,
|
package/dest/base_bot.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import {
|
|
2
|
+
import 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 { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
@@ -16,6 +16,6 @@ export declare abstract class BaseBot {
|
|
|
16
16
|
run(): Promise<TxReceipt | TxHash>;
|
|
17
17
|
protected abstract createAndSendTx(logCtx: object): Promise<TxHash>;
|
|
18
18
|
protected onTxMined(_receipt: TxReceipt, _logCtx: object): Promise<void>;
|
|
19
|
-
protected getSendMethodOpts(
|
|
19
|
+
protected getSendMethodOpts(): SendInteractionOptions;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZV9ib3QuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9iYXNlX2JvdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsc0JBQXNCLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUd4RSxPQUFPLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBWSxNQUFNLG9CQUFvQixDQUFDO0FBRWpFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sS0FBSyxFQUFFLGNBQWMsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRTlELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUU3Qyw4QkFBc0IsT0FBTzthQU9ULElBQUksRUFBRSxTQUFTO2FBQ2YsTUFBTSxFQUFFLGNBQWM7YUFDdEIscUJBQXFCLEVBQUUsWUFBWTtJQUM1QyxNQUFNLEVBQUUsU0FBUztJQVQxQixTQUFTLENBQUMsR0FBRyx1Q0FBdUI7SUFFcEMsU0FBUyxDQUFDLFFBQVEsRUFBRSxNQUFNLENBQUs7SUFDL0IsU0FBUyxDQUFDLFNBQVMsRUFBRSxNQUFNLENBQUs7SUFFaEMsU0FBUyxhQUNTLElBQUksRUFBRSxTQUFTLEVBQ2YsTUFBTSxFQUFFLGNBQWMsRUFDdEIscUJBQXFCLEVBQUUsWUFBWSxFQUM1QyxNQUFNLEVBQUUsU0FBUyxFQUN0QjtJQUVTLEdBQUcsSUFBSSxPQUFPLENBQUMsU0FBUyxHQUFHLE1BQU0sQ0FBQyxDQXlCOUM7SUFFRCxTQUFTLENBQUMsUUFBUSxDQUFDLGVBQWUsQ0FBQyxNQUFNLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUVwRSxTQUFTLENBQUMsU0FBUyxDQUFDLFFBQVEsRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBR3ZFO0lBRUQsU0FBUyxDQUFDLGlCQUFpQixJQUFJLHNCQUFzQixDQWNwRDtDQUNGIn0=
|
package/dest/base_bot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base_bot.d.ts","sourceRoot":"","sources":["../src/base_bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"base_bot.d.ts","sourceRoot":"","sources":["../src/base_bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGxE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAY,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,8BAAsB,OAAO;aAOT,IAAI,EAAE,SAAS;aACf,MAAM,EAAE,cAAc;aACtB,qBAAqB,EAAE,YAAY;IAC5C,MAAM,EAAE,SAAS;IAT1B,SAAS,CAAC,GAAG,uCAAuB;IAEpC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAK;IAC/B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAK;IAEhC,SAAS,aACS,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,cAAc,EACtB,qBAAqB,EAAE,YAAY,EAC5C,MAAM,EAAE,SAAS,EACtB;IAES,GAAG,IAAI,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,CAyB9C;IAED,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEpE,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvE;IAED,SAAS,CAAC,iBAAiB,IAAI,sBAAsB,CAcpD;CACF"}
|
package/dest/base_bot.js
CHANGED
|
@@ -48,32 +48,22 @@ export class BaseBot {
|
|
|
48
48
|
// no-op
|
|
49
49
|
return Promise.resolve();
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
getSendMethodOpts() {
|
|
52
52
|
const { l2GasLimit, daGasLimit, minFeePadding } = this.config;
|
|
53
53
|
this.wallet.setMinFeePadding(minFeePadding);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})
|
|
61
|
-
};
|
|
62
|
-
this.log.verbose(`Using gas limits ${l2GasLimit} L2 gas ${daGasLimit} DA gas`);
|
|
63
|
-
} else {
|
|
64
|
-
this.log.verbose(`Estimating gas for transaction`);
|
|
65
|
-
({ estimatedGas: gasSettings } = await interaction.simulate({
|
|
66
|
-
fee: {
|
|
67
|
-
estimateGas: true
|
|
68
|
-
},
|
|
69
|
-
from: this.defaultAccountAddress
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
54
|
+
const gasSettings = l2GasLimit !== undefined && l2GasLimit > 0 && daGasLimit !== undefined && daGasLimit > 0 ? {
|
|
55
|
+
gasLimits: Gas.from({
|
|
56
|
+
l2Gas: l2GasLimit,
|
|
57
|
+
daGas: daGasLimit
|
|
58
|
+
})
|
|
59
|
+
} : undefined;
|
|
72
60
|
return {
|
|
73
61
|
from: this.defaultAccountAddress,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
...gasSettings ? {
|
|
63
|
+
fee: {
|
|
64
|
+
gasSettings
|
|
65
|
+
}
|
|
66
|
+
} : {}
|
|
77
67
|
};
|
|
78
68
|
}
|
|
79
69
|
}
|
package/dest/bot.d.ts
CHANGED
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm90LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvYm90LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBRTlELE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUU1QyxPQUFPLEtBQUssRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHVDQUF1QyxDQUFDO0FBQ2xGLE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxjQUFjLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRixPQUFPLEtBQUssRUFBRSxjQUFj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fer_in_public(this.defaultAccountAddress, recipient, TRANSFER_AMOUNT, 0))
|
|
31
31
|
].flat() : times(privateTransfersPerTx, ()=>token.methods.transfer(TRANSFER_AMOUNT, this.defaultAccountAddress, recipient));
|
|
32
32
|
const batch = new BatchCall(wallet, calls);
|
|
33
|
-
const opts =
|
|
34
|
-
this.log.verbose(`Simulating transaction with ${calls.length}`, logCtx);
|
|
35
|
-
await batch.simulate({
|
|
36
|
-
from: this.defaultAccountAddress
|
|
37
|
-
});
|
|
33
|
+
const opts = this.getSendMethodOpts();
|
|
38
34
|
this.log.verbose(`Sending transaction`, logCtx);
|
|
39
35
|
const { txHash } = await batch.send({
|
|
40
36
|
...opts,
|
package/dest/config.d.ts
CHANGED
|
@@ -50,9 +50,9 @@ export type BotConfig = {
|
|
|
50
50
|
maxPendingTxs: number;
|
|
51
51
|
/** Whether to flush after sending each 'setup' transaction */
|
|
52
52
|
flushSetupTransactions: boolean;
|
|
53
|
-
/** L2 gas limit for the tx (empty to
|
|
53
|
+
/** L2 gas limit for the tx (empty to let the bot's wallet estimate). */
|
|
54
54
|
l2GasLimit: number | undefined;
|
|
55
|
-
/** DA gas limit for the tx (empty to
|
|
55
|
+
/** DA gas limit for the tx (empty to let the bot's wallet estimate). */
|
|
56
56
|
daGasLimit: number | undefined;
|
|
57
57
|
/** Token contract to use */
|
|
58
58
|
contract: SupportedTokenContracts;
|
|
@@ -223,4 +223,4 @@ export declare function getBotConfigFromEnv(): BotConfig;
|
|
|
223
223
|
export declare function getBotDefaultConfig(): BotConfig;
|
|
224
224
|
export declare function getVersions(): Partial<ComponentsVersions>;
|
|
225
225
|
export {};
|
|
226
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
226
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGlu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CAAC,eAAe,EAAE,eAAe,GAAG,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8C3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,SAAS,CAmK3D,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,SAAS,CAE/C;AAED,wBAAgB,mBAAmB,IAAI,SAAS,CAE/C;AAED,wBAAgB,WAAW,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAKzD"}
|
package/dest/config.js
CHANGED
|
@@ -172,12 +172,12 @@ export const botConfigMappings = {
|
|
|
172
172
|
},
|
|
173
173
|
l2GasLimit: {
|
|
174
174
|
env: 'BOT_L2_GAS_LIMIT',
|
|
175
|
-
description:
|
|
175
|
+
description: "L2 gas limit for the tx (empty to let the bot's wallet estimate).",
|
|
176
176
|
...optionalNumberConfigHelper()
|
|
177
177
|
},
|
|
178
178
|
daGasLimit: {
|
|
179
179
|
env: 'BOT_DA_GAS_LIMIT',
|
|
180
|
-
description:
|
|
180
|
+
description: "DA gas limit for the tx (empty to let the bot's wallet estimate).",
|
|
181
181
|
...optionalNumberConfigHelper()
|
|
182
182
|
},
|
|
183
183
|
contract: {
|
package/dest/cross_chain_bot.js
CHANGED
|
@@ -82,7 +82,7 @@ import { seedL1ToL2Message } from './l1_to_l2_seeding.js';
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
const batch = new BatchCall(this.wallet, calls);
|
|
85
|
-
const opts =
|
|
85
|
+
const opts = this.getSendMethodOpts();
|
|
86
86
|
this.log.verbose(`Sending cross-chain batch with ${calls.length} calls`, logCtx);
|
|
87
87
|
const { txHash } = await batch.send({
|
|
88
88
|
...opts,
|
package/dest/factory.d.ts
CHANGED
|
@@ -61,4 +61,4 @@ export declare class BotFactory {
|
|
|
61
61
|
private bridgeL1FeeJuice;
|
|
62
62
|
private withNoMinTxsPerBlock;
|
|
63
63
|
}
|
|
64
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
64
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2ZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBb0J6RCxPQUFPLEtBQUssRUFBRSx3QkFBd0IsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBSXRFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQztBQUMzRCxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSx1Q0FBdUMsQ0FBQztBQUM3RSxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDL0QsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLG9DQUFvQyxDQUFDO0FBRWxFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxjQUFjLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVqRixPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFekQsT0FBTyxFQUFFLEtBQUssU0FBUyxFQUEyQixNQUFNLGFBQWEsQ0FBQztBQUV0RSxPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQU1qRCxxQkFBYSxVQUFVO0lBSW5CLE9BQU8sQ0FBQyxRQUFRLENBQUMsTUFBTTtJQUN2QixPQUFPLENBQUMsUUFBUSxDQUFDLE1BQU07SUFDdkIs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FDaEIsUUFBUSxFQUFFLHdCQUF3QixDQUFDO1FBQ25DLGFBQWEsRUFBRSxNQUFNLENBQUM7S0FDdkIsQ0FBQyxDQTJERDtZQUVhLGlCQUFpQjtZQWVqQixZQUFZO1lBV1osMEJBQTBCO1lBdUMxQixnQkFBZ0I7WUFlaEIsVUFBVTtZQXNEVixrQkFBa0I7WUFhbEIsZ0JBQWdCO1lBd0JoQixPQUFPO1lBK0ZQLHdCQUF3QjtZQTBCeEIsVUFBVTtZQWlEVixzQkFBc0I7WUEyQnRCLGdCQUFnQjtZQStCaEIsb0JBQW9CO0NBZW5DIn0=
|
package/dest/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAoBzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAItE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,KAAK,SAAS,EAA2B,MAAM,aAAa,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMjD,qBAAa,UAAU;IAInB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAC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,5 +1,5 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
-
import {
|
|
2
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
3
3
|
import { BatchCall, NO_WAIT } from '@aztec/aztec.js/contracts';
|
|
4
4
|
import { L1FeeJuicePortalManager } from '@aztec/aztec.js/ethereum';
|
|
5
5
|
import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
@@ -7,6 +7,7 @@ import { deriveKeys } from '@aztec/aztec.js/keys';
|
|
|
7
7
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
8
8
|
import { waitForL1ToL2MessageReady } from '@aztec/aztec.js/messaging';
|
|
9
9
|
import { waitForTx } from '@aztec/aztec.js/node';
|
|
10
|
+
import { ContractInitializationStatus } from '@aztec/aztec.js/wallet';
|
|
10
11
|
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
11
12
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
12
13
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
@@ -17,7 +18,6 @@ import { AMMContract } from '@aztec/noir-contracts.js/AMM';
|
|
|
17
18
|
import { PrivateTokenContract } from '@aztec/noir-contracts.js/PrivateToken';
|
|
18
19
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
19
20
|
import { TestContract } from '@aztec/noir-test-contracts.js/Test';
|
|
20
|
-
import { GasFees, GasSettings } from '@aztec/stdlib/gas';
|
|
21
21
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
22
22
|
import { SupportedTokenContracts } from './config.js';
|
|
23
23
|
import { seedL1ToL2Message } from './l1_to_l2_seeding.js';
|
|
@@ -152,7 +152,7 @@ export class BotFactory {
|
|
|
152
152
|
const signingKey = deriveSigningKey(secret);
|
|
153
153
|
const accountManager = await this.wallet.createSchnorrAccount(secret, salt, signingKey);
|
|
154
154
|
const metadata = await this.wallet.getContractMetadata(accountManager.address);
|
|
155
|
-
if (metadata.
|
|
155
|
+
if (metadata.initializationStatus === ContractInitializationStatus.INITIALIZED) {
|
|
156
156
|
this.log.info(`Account at ${accountManager.address.toString()} already initialized`);
|
|
157
157
|
const timer = new Timer();
|
|
158
158
|
const address = accountManager.address;
|
|
@@ -165,31 +165,15 @@ export class BotFactory {
|
|
|
165
165
|
const claim = await this.getOrCreateBridgeClaim(address);
|
|
166
166
|
const paymentMethod = new FeeJuicePaymentMethodWithClaim(accountManager.address, claim);
|
|
167
167
|
const deployMethod = await accountManager.getDeployMethod();
|
|
168
|
-
const maxFeesPerGas = (await this.aztecNode.getCurrentMinFees()).mul(1 + this.config.minFeePadding);
|
|
169
|
-
const { estimatedGas } = await deployMethod.simulate({
|
|
170
|
-
from: AztecAddress.ZERO,
|
|
171
|
-
fee: {
|
|
172
|
-
estimateGas: true,
|
|
173
|
-
paymentMethod
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
const gasSettings = GasSettings.from({
|
|
177
|
-
...estimatedGas,
|
|
178
|
-
maxFeesPerGas,
|
|
179
|
-
maxPriorityFeesPerGas: GasFees.empty()
|
|
180
|
-
});
|
|
181
168
|
await this.withNoMinTxsPerBlock(async ()=>{
|
|
182
169
|
const { txHash } = await deployMethod.send({
|
|
183
|
-
from:
|
|
170
|
+
from: NO_FROM,
|
|
184
171
|
fee: {
|
|
185
|
-
gasSettings,
|
|
186
172
|
paymentMethod
|
|
187
173
|
},
|
|
188
174
|
wait: NO_WAIT
|
|
189
175
|
});
|
|
190
|
-
this.log.info(`Sent tx for account deployment with hash ${txHash.toString()}
|
|
191
|
-
gasSettings
|
|
192
|
-
});
|
|
176
|
+
this.log.info(`Sent tx for account deployment with hash ${txHash.toString()}`);
|
|
193
177
|
return waitForTx(this.aztecNode, txHash, {
|
|
194
178
|
timeout: this.config.txMinedWaitSeconds
|
|
195
179
|
});
|
|
@@ -248,22 +232,11 @@ export class BotFactory {
|
|
|
248
232
|
await deploy.register();
|
|
249
233
|
} else {
|
|
250
234
|
this.log.info(`Deploying token contract at ${address.toString()}`);
|
|
251
|
-
const { estimatedGas } = await deploy.simulate({
|
|
252
|
-
...deployOpts,
|
|
253
|
-
fee: {
|
|
254
|
-
estimateGas: true
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
235
|
const { txHash } = await deploy.send({
|
|
258
236
|
...deployOpts,
|
|
259
|
-
fee: {
|
|
260
|
-
gasSettings: estimatedGas
|
|
261
|
-
},
|
|
262
237
|
wait: NO_WAIT
|
|
263
238
|
});
|
|
264
|
-
this.log.info(`Sent tx for token setup with hash ${txHash.toString()}
|
|
265
|
-
estimatedGas
|
|
266
|
-
});
|
|
239
|
+
this.log.info(`Sent tx for token setup with hash ${txHash.toString()}`);
|
|
267
240
|
await this.withNoMinTxsPerBlock(async ()=>{
|
|
268
241
|
await waitForTx(this.aztecNode, txHash, {
|
|
269
242
|
timeout: this.config.txMinedWaitSeconds
|
|
@@ -298,24 +271,13 @@ export class BotFactory {
|
|
|
298
271
|
const amm = AMMContract.at(instance.address, this.wallet);
|
|
299
272
|
this.log.info(`AMM deployed at ${amm.address}`);
|
|
300
273
|
const setMinterInteraction = lpToken.methods.set_minter(amm.address, true);
|
|
301
|
-
const { estimatedGas: setMinterGas } = await setMinterInteraction.simulate({
|
|
302
|
-
from: deployer,
|
|
303
|
-
fee: {
|
|
304
|
-
estimateGas: true
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
274
|
const { receipt: minterReceipt } = await setMinterInteraction.send({
|
|
308
275
|
from: deployer,
|
|
309
|
-
fee: {
|
|
310
|
-
gasSettings: setMinterGas
|
|
311
|
-
},
|
|
312
276
|
wait: {
|
|
313
277
|
timeout: this.config.txMinedWaitSeconds
|
|
314
278
|
}
|
|
315
279
|
});
|
|
316
|
-
this.log.info(`Set LP token minter to AMM txHash=${minterReceipt.txHash.toString()}
|
|
317
|
-
estimatedGas: setMinterGas
|
|
318
|
-
});
|
|
280
|
+
this.log.info(`Set LP token minter to AMM txHash=${minterReceipt.txHash.toString()}`);
|
|
319
281
|
this.log.info(`Liquidity token initialized`);
|
|
320
282
|
return amm;
|
|
321
283
|
}
|
|
@@ -352,40 +314,16 @@ export class BotFactory {
|
|
|
352
314
|
token0.methods.mint_to_private(liquidityProvider, MINT_BALANCE),
|
|
353
315
|
token1.methods.mint_to_private(liquidityProvider, MINT_BALANCE)
|
|
354
316
|
]);
|
|
355
|
-
const { estimatedGas: mintGas } = await mintBatch.simulate({
|
|
356
|
-
from: liquidityProvider,
|
|
357
|
-
fee: {
|
|
358
|
-
estimateGas: true
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
317
|
const { receipt: mintReceipt } = await mintBatch.send({
|
|
362
318
|
from: liquidityProvider,
|
|
363
|
-
fee: {
|
|
364
|
-
gasSettings: mintGas
|
|
365
|
-
},
|
|
366
319
|
wait: {
|
|
367
320
|
timeout: this.config.txMinedWaitSeconds
|
|
368
321
|
}
|
|
369
322
|
});
|
|
370
|
-
this.log.info(`Sent mint tx: ${mintReceipt.txHash.toString()}
|
|
371
|
-
estimatedGas: mintGas
|
|
372
|
-
});
|
|
323
|
+
this.log.info(`Sent mint tx: ${mintReceipt.txHash.toString()}`);
|
|
373
324
|
const addLiquidityInteraction = amm.methods.add_liquidity(amount0Max, amount1Max, amount0Min, amount1Min, authwitNonce);
|
|
374
|
-
const { estimatedGas: addLiquidityGas } = await addLiquidityInteraction.simulate({
|
|
375
|
-
from: liquidityProvider,
|
|
376
|
-
fee: {
|
|
377
|
-
estimateGas: true
|
|
378
|
-
},
|
|
379
|
-
authWitnesses: [
|
|
380
|
-
token0Authwit,
|
|
381
|
-
token1Authwit
|
|
382
|
-
]
|
|
383
|
-
});
|
|
384
325
|
const { receipt: addLiquidityReceipt } = await addLiquidityInteraction.send({
|
|
385
326
|
from: liquidityProvider,
|
|
386
|
-
fee: {
|
|
387
|
-
gasSettings: addLiquidityGas
|
|
388
|
-
},
|
|
389
327
|
authWitnesses: [
|
|
390
328
|
token0Authwit,
|
|
391
329
|
token1Authwit
|
|
@@ -394,9 +332,7 @@ export class BotFactory {
|
|
|
394
332
|
timeout: this.config.txMinedWaitSeconds
|
|
395
333
|
}
|
|
396
334
|
});
|
|
397
|
-
this.log.info(`Sent tx to add liquidity to the AMM: ${addLiquidityReceipt.txHash.toString()}
|
|
398
|
-
estimatedGas: addLiquidityGas
|
|
399
|
-
});
|
|
335
|
+
this.log.info(`Sent tx to add liquidity to the AMM: ${addLiquidityReceipt.txHash.toString()}`);
|
|
400
336
|
this.log.info(`Liquidity added`);
|
|
401
337
|
const [newT0Bal, newT1Bal, newLPBal] = await getPrivateBalances();
|
|
402
338
|
this.log.info(`Updated private balances of ${defaultAccountAddress} after minting and funding AMM: token0=${newT0Bal}, token1=${newT1Bal}, lp=${newLPBal}`);
|
|
@@ -409,21 +345,10 @@ export class BotFactory {
|
|
|
409
345
|
this.log.info(`Contract ${name} at ${address.toString()} already deployed`);
|
|
410
346
|
await deploy.register();
|
|
411
347
|
} else {
|
|
412
|
-
|
|
413
|
-
...deployOpts,
|
|
414
|
-
fee: {
|
|
415
|
-
estimateGas: true
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
this.log.info(`Deploying contract ${name} at ${address.toString()}`, {
|
|
419
|
-
estimatedGas
|
|
420
|
-
});
|
|
348
|
+
this.log.info(`Deploying contract ${name} at ${address.toString()}`);
|
|
421
349
|
await this.withNoMinTxsPerBlock(async ()=>{
|
|
422
350
|
const { txHash } = await deploy.send({
|
|
423
351
|
...deployOpts,
|
|
424
|
-
fee: {
|
|
425
|
-
gasSettings: estimatedGas
|
|
426
|
-
},
|
|
427
352
|
wait: NO_WAIT
|
|
428
353
|
});
|
|
429
354
|
this.log.info(`Sent contract ${name} setup tx with hash ${txHash.toString()}`);
|
|
@@ -464,25 +389,13 @@ export class BotFactory {
|
|
|
464
389
|
token.address
|
|
465
390
|
];
|
|
466
391
|
const mintBatch = new BatchCall(token.wallet, calls);
|
|
467
|
-
const { estimatedGas } = await mintBatch.simulate({
|
|
468
|
-
from: minter,
|
|
469
|
-
fee: {
|
|
470
|
-
estimateGas: true
|
|
471
|
-
},
|
|
472
|
-
additionalScopes
|
|
473
|
-
});
|
|
474
392
|
await this.withNoMinTxsPerBlock(async ()=>{
|
|
475
393
|
const { txHash } = await mintBatch.send({
|
|
476
394
|
from: minter,
|
|
477
395
|
additionalScopes,
|
|
478
|
-
fee: {
|
|
479
|
-
gasSettings: estimatedGas
|
|
480
|
-
},
|
|
481
396
|
wait: NO_WAIT
|
|
482
397
|
});
|
|
483
|
-
this.log.info(`Sent token mint tx with hash ${txHash.toString()}
|
|
484
|
-
estimatedGas
|
|
485
|
-
});
|
|
398
|
+
this.log.info(`Sent token mint tx with hash ${txHash.toString()}`);
|
|
486
399
|
return waitForTx(this.aztecNode, txHash, {
|
|
487
400
|
timeout: this.config.txMinedWaitSeconds
|
|
488
401
|
});
|
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.9ef841308",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -54,20 +54,20 @@
|
|
|
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/l1-artifacts": "0.0.1-commit.
|
|
64
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
65
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
66
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
67
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
68
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
69
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
70
|
-
"@aztec/wallets": "0.0.1-commit.
|
|
57
|
+
"@aztec/accounts": "0.0.1-commit.9ef841308",
|
|
58
|
+
"@aztec/aztec.js": "0.0.1-commit.9ef841308",
|
|
59
|
+
"@aztec/entrypoints": "0.0.1-commit.9ef841308",
|
|
60
|
+
"@aztec/ethereum": "0.0.1-commit.9ef841308",
|
|
61
|
+
"@aztec/foundation": "0.0.1-commit.9ef841308",
|
|
62
|
+
"@aztec/kv-store": "0.0.1-commit.9ef841308",
|
|
63
|
+
"@aztec/l1-artifacts": "0.0.1-commit.9ef841308",
|
|
64
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.9ef841308",
|
|
65
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.9ef841308",
|
|
66
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.9ef841308",
|
|
67
|
+
"@aztec/protocol-contracts": "0.0.1-commit.9ef841308",
|
|
68
|
+
"@aztec/stdlib": "0.0.1-commit.9ef841308",
|
|
69
|
+
"@aztec/telemetry-client": "0.0.1-commit.9ef841308",
|
|
70
|
+
"@aztec/wallets": "0.0.1-commit.9ef841308",
|
|
71
71
|
"source-map-support": "^0.5.21",
|
|
72
72
|
"tslib": "^2.4.0",
|
|
73
73
|
"viem": "npm:@aztec/viem@2.38.2",
|
package/src/amm_bot.ts
CHANGED
|
@@ -87,7 +87,7 @@ export class AmmBot extends BaseBot {
|
|
|
87
87
|
authWitnesses: [swapAuthwit],
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
const opts =
|
|
90
|
+
const opts = this.getSendMethodOpts();
|
|
91
91
|
|
|
92
92
|
this.log.verbose(`Sending transaction`, logCtx);
|
|
93
93
|
this.log.info(`Tx. Balances: ${jsonStringify(balances)}`, { ...logCtx, balances });
|
package/src/base_bot.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import {
|
|
2
|
+
import type { SendInteractionOptions } from '@aztec/aztec.js/contracts';
|
|
3
3
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
4
4
|
import { waitForTx } from '@aztec/aztec.js/node';
|
|
5
5
|
import { TxHash, TxReceipt, TxStatus } from '@aztec/aztec.js/tx';
|
|
@@ -56,27 +56,19 @@ export abstract class BaseBot {
|
|
|
56
56
|
return Promise.resolve();
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
protected
|
|
60
|
-
interaction: ContractFunctionInteraction | BatchCall,
|
|
61
|
-
): Promise<SendInteractionOptions> {
|
|
59
|
+
protected getSendMethodOpts(): SendInteractionOptions {
|
|
62
60
|
const { l2GasLimit, daGasLimit, minFeePadding } = this.config;
|
|
63
61
|
|
|
64
62
|
this.wallet.setMinFeePadding(minFeePadding);
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this.log.verbose(`Estimating gas for transaction`);
|
|
72
|
-
({ estimatedGas: gasSettings } = await interaction.simulate({
|
|
73
|
-
fee: { estimateGas: true },
|
|
74
|
-
from: this.defaultAccountAddress,
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
64
|
+
const gasSettings =
|
|
65
|
+
l2GasLimit !== undefined && l2GasLimit > 0 && daGasLimit !== undefined && daGasLimit > 0
|
|
66
|
+
? { gasLimits: Gas.from({ l2Gas: l2GasLimit, daGas: daGasLimit }) }
|
|
67
|
+
: undefined;
|
|
68
|
+
|
|
77
69
|
return {
|
|
78
70
|
from: this.defaultAccountAddress,
|
|
79
|
-
fee: { gasSettings },
|
|
71
|
+
...(gasSettings ? { fee: { gasSettings } } : {}),
|
|
80
72
|
};
|
|
81
73
|
}
|
|
82
74
|
}
|
package/src/bot.ts
CHANGED
|
@@ -70,10 +70,7 @@ export class Bot extends BaseBot {
|
|
|
70
70
|
);
|
|
71
71
|
|
|
72
72
|
const batch = new BatchCall(wallet, calls);
|
|
73
|
-
const opts =
|
|
74
|
-
|
|
75
|
-
this.log.verbose(`Simulating transaction with ${calls.length}`, logCtx);
|
|
76
|
-
await batch.simulate({ from: this.defaultAccountAddress });
|
|
73
|
+
const opts = this.getSendMethodOpts();
|
|
77
74
|
|
|
78
75
|
this.log.verbose(`Sending transaction`, logCtx);
|
|
79
76
|
const { txHash } = await batch.send({ ...opts, wait: NO_WAIT });
|
package/src/config.ts
CHANGED
|
@@ -69,9 +69,9 @@ export type BotConfig = {
|
|
|
69
69
|
maxPendingTxs: number;
|
|
70
70
|
/** Whether to flush after sending each 'setup' transaction */
|
|
71
71
|
flushSetupTransactions: boolean;
|
|
72
|
-
/** L2 gas limit for the tx (empty to
|
|
72
|
+
/** L2 gas limit for the tx (empty to let the bot's wallet estimate). */
|
|
73
73
|
l2GasLimit: number | undefined;
|
|
74
|
-
/** DA gas limit for the tx (empty to
|
|
74
|
+
/** DA gas limit for the tx (empty to let the bot's wallet estimate). */
|
|
75
75
|
daGasLimit: number | undefined;
|
|
76
76
|
/** Token contract to use */
|
|
77
77
|
contract: SupportedTokenContracts;
|
|
@@ -243,12 +243,12 @@ export const botConfigMappings: ConfigMappingsType<BotConfig> = {
|
|
|
243
243
|
},
|
|
244
244
|
l2GasLimit: {
|
|
245
245
|
env: 'BOT_L2_GAS_LIMIT',
|
|
246
|
-
description:
|
|
246
|
+
description: "L2 gas limit for the tx (empty to let the bot's wallet estimate).",
|
|
247
247
|
...optionalNumberConfigHelper(),
|
|
248
248
|
},
|
|
249
249
|
daGasLimit: {
|
|
250
250
|
env: 'BOT_DA_GAS_LIMIT',
|
|
251
|
-
description:
|
|
251
|
+
description: "DA gas limit for the tx (empty to let the bot's wallet estimate).",
|
|
252
252
|
...optionalNumberConfigHelper(),
|
|
253
253
|
},
|
|
254
254
|
contract: {
|
package/src/cross_chain_bot.ts
CHANGED
|
@@ -137,7 +137,7 @@ export class CrossChainBot extends BaseBot {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
const batch = new BatchCall(this.wallet, calls);
|
|
140
|
-
const opts =
|
|
140
|
+
const opts = this.getSendMethodOpts();
|
|
141
141
|
|
|
142
142
|
this.log.verbose(`Sending cross-chain batch with ${calls.length} calls`, logCtx);
|
|
143
143
|
const { txHash } = await batch.send({ ...opts, wait: NO_WAIT });
|
package/src/factory.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
2
3
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
4
|
import {
|
|
4
5
|
BatchCall,
|
|
@@ -15,6 +16,7 @@ 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';
|
|
17
18
|
import { waitForTx } from '@aztec/aztec.js/node';
|
|
19
|
+
import { ContractInitializationStatus } from '@aztec/aztec.js/wallet';
|
|
18
20
|
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
19
21
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
20
22
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
@@ -27,7 +29,6 @@ import { PrivateTokenContract } from '@aztec/noir-contracts.js/PrivateToken';
|
|
|
27
29
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
28
30
|
import { TestContract } from '@aztec/noir-test-contracts.js/Test';
|
|
29
31
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
30
|
-
import { GasFees, GasSettings } from '@aztec/stdlib/gas';
|
|
31
32
|
import type { AztecNode, AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
32
33
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
33
34
|
import { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
@@ -207,7 +208,7 @@ export class BotFactory {
|
|
|
207
208
|
const signingKey = deriveSigningKey(secret);
|
|
208
209
|
const accountManager = await this.wallet.createSchnorrAccount(secret, salt, signingKey);
|
|
209
210
|
const metadata = await this.wallet.getContractMetadata(accountManager.address);
|
|
210
|
-
if (metadata.
|
|
211
|
+
if (metadata.initializationStatus === ContractInitializationStatus.INITIALIZED) {
|
|
211
212
|
this.log.info(`Account at ${accountManager.address.toString()} already initialized`);
|
|
212
213
|
const timer = new Timer();
|
|
213
214
|
const address = accountManager.address;
|
|
@@ -222,21 +223,14 @@ export class BotFactory {
|
|
|
222
223
|
|
|
223
224
|
const paymentMethod = new FeeJuicePaymentMethodWithClaim(accountManager.address, claim);
|
|
224
225
|
const deployMethod = await accountManager.getDeployMethod();
|
|
225
|
-
const maxFeesPerGas = (await this.aztecNode.getCurrentMinFees()).mul(1 + this.config.minFeePadding);
|
|
226
|
-
|
|
227
|
-
const { estimatedGas } = await deployMethod.simulate({
|
|
228
|
-
from: AztecAddress.ZERO,
|
|
229
|
-
fee: { estimateGas: true, paymentMethod },
|
|
230
|
-
});
|
|
231
|
-
const gasSettings = GasSettings.from({ ...estimatedGas!, maxFeesPerGas, maxPriorityFeesPerGas: GasFees.empty() });
|
|
232
226
|
|
|
233
227
|
await this.withNoMinTxsPerBlock(async () => {
|
|
234
228
|
const { txHash } = await deployMethod.send({
|
|
235
|
-
from:
|
|
236
|
-
fee: {
|
|
229
|
+
from: NO_FROM,
|
|
230
|
+
fee: { paymentMethod },
|
|
237
231
|
wait: NO_WAIT,
|
|
238
232
|
});
|
|
239
|
-
this.log.info(`Sent tx for account deployment with hash ${txHash.toString()}
|
|
233
|
+
this.log.info(`Sent tx for account deployment with hash ${txHash.toString()}`);
|
|
240
234
|
return waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds });
|
|
241
235
|
});
|
|
242
236
|
this.log.info(`Account deployed at ${address}`);
|
|
@@ -302,9 +296,8 @@ export class BotFactory {
|
|
|
302
296
|
await deploy.register();
|
|
303
297
|
} else {
|
|
304
298
|
this.log.info(`Deploying token contract at ${address.toString()}`);
|
|
305
|
-
const {
|
|
306
|
-
|
|
307
|
-
this.log.info(`Sent tx for token setup with hash ${txHash.toString()}`, { estimatedGas });
|
|
299
|
+
const { txHash } = await deploy.send({ ...deployOpts, wait: NO_WAIT });
|
|
300
|
+
this.log.info(`Sent tx for token setup with hash ${txHash.toString()}`);
|
|
308
301
|
await this.withNoMinTxsPerBlock(async () => {
|
|
309
302
|
await waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds });
|
|
310
303
|
return token;
|
|
@@ -345,18 +338,11 @@ export class BotFactory {
|
|
|
345
338
|
|
|
346
339
|
this.log.info(`AMM deployed at ${amm.address}`);
|
|
347
340
|
const setMinterInteraction = lpToken.methods.set_minter(amm.address, true);
|
|
348
|
-
const { estimatedGas: setMinterGas } = await setMinterInteraction.simulate({
|
|
349
|
-
from: deployer,
|
|
350
|
-
fee: { estimateGas: true },
|
|
351
|
-
});
|
|
352
341
|
const { receipt: minterReceipt } = await setMinterInteraction.send({
|
|
353
342
|
from: deployer,
|
|
354
|
-
fee: { gasSettings: setMinterGas },
|
|
355
343
|
wait: { timeout: this.config.txMinedWaitSeconds },
|
|
356
344
|
});
|
|
357
|
-
this.log.info(`Set LP token minter to AMM txHash=${minterReceipt.txHash.toString()}
|
|
358
|
-
estimatedGas: setMinterGas,
|
|
359
|
-
});
|
|
345
|
+
this.log.info(`Set LP token minter to AMM txHash=${minterReceipt.txHash.toString()}`);
|
|
360
346
|
this.log.info(`Liquidity token initialized`);
|
|
361
347
|
|
|
362
348
|
return amm;
|
|
@@ -428,17 +414,12 @@ export class BotFactory {
|
|
|
428
414
|
token0.methods.mint_to_private(liquidityProvider, MINT_BALANCE),
|
|
429
415
|
token1.methods.mint_to_private(liquidityProvider, MINT_BALANCE),
|
|
430
416
|
]);
|
|
431
|
-
const { estimatedGas: mintGas } = await mintBatch.simulate({
|
|
432
|
-
from: liquidityProvider,
|
|
433
|
-
fee: { estimateGas: true },
|
|
434
|
-
});
|
|
435
417
|
const { receipt: mintReceipt } = await mintBatch.send({
|
|
436
418
|
from: liquidityProvider,
|
|
437
|
-
fee: { gasSettings: mintGas },
|
|
438
419
|
wait: { timeout: this.config.txMinedWaitSeconds },
|
|
439
420
|
});
|
|
440
421
|
|
|
441
|
-
this.log.info(`Sent mint tx: ${mintReceipt.txHash.toString()}
|
|
422
|
+
this.log.info(`Sent mint tx: ${mintReceipt.txHash.toString()}`);
|
|
442
423
|
|
|
443
424
|
const addLiquidityInteraction = amm.methods.add_liquidity(
|
|
444
425
|
amount0Max,
|
|
@@ -447,21 +428,13 @@ export class BotFactory {
|
|
|
447
428
|
amount1Min,
|
|
448
429
|
authwitNonce,
|
|
449
430
|
);
|
|
450
|
-
const { estimatedGas: addLiquidityGas } = await addLiquidityInteraction.simulate({
|
|
451
|
-
from: liquidityProvider,
|
|
452
|
-
fee: { estimateGas: true },
|
|
453
|
-
authWitnesses: [token0Authwit, token1Authwit],
|
|
454
|
-
});
|
|
455
431
|
const { receipt: addLiquidityReceipt } = await addLiquidityInteraction.send({
|
|
456
432
|
from: liquidityProvider,
|
|
457
|
-
fee: { gasSettings: addLiquidityGas },
|
|
458
433
|
authWitnesses: [token0Authwit, token1Authwit],
|
|
459
434
|
wait: { timeout: this.config.txMinedWaitSeconds },
|
|
460
435
|
});
|
|
461
436
|
|
|
462
|
-
this.log.info(`Sent tx to add liquidity to the AMM: ${addLiquidityReceipt.txHash.toString()}
|
|
463
|
-
estimatedGas: addLiquidityGas,
|
|
464
|
-
});
|
|
437
|
+
this.log.info(`Sent tx to add liquidity to the AMM: ${addLiquidityReceipt.txHash.toString()}`);
|
|
465
438
|
this.log.info(`Liquidity added`);
|
|
466
439
|
|
|
467
440
|
const [newT0Bal, newT1Bal, newLPBal] = await getPrivateBalances();
|
|
@@ -482,10 +455,9 @@ export class BotFactory {
|
|
|
482
455
|
this.log.info(`Contract ${name} at ${address.toString()} already deployed`);
|
|
483
456
|
await deploy.register();
|
|
484
457
|
} else {
|
|
485
|
-
|
|
486
|
-
this.log.info(`Deploying contract ${name} at ${address.toString()}`, { estimatedGas });
|
|
458
|
+
this.log.info(`Deploying contract ${name} at ${address.toString()}`);
|
|
487
459
|
await this.withNoMinTxsPerBlock(async () => {
|
|
488
|
-
const { txHash } = await deploy.send({ ...deployOpts,
|
|
460
|
+
const { txHash } = await deploy.send({ ...deployOpts, wait: NO_WAIT });
|
|
489
461
|
this.log.info(`Sent contract ${name} setup tx with hash ${txHash.toString()}`);
|
|
490
462
|
return waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds });
|
|
491
463
|
});
|
|
@@ -530,15 +502,13 @@ export class BotFactory {
|
|
|
530
502
|
// PrivateToken's mint accesses contract-level private storage vars (admin, total_supply).
|
|
531
503
|
const additionalScopes = isStandardToken ? undefined : [token.address];
|
|
532
504
|
const mintBatch = new BatchCall(token.wallet, calls);
|
|
533
|
-
const { estimatedGas } = await mintBatch.simulate({ from: minter, fee: { estimateGas: true }, additionalScopes });
|
|
534
505
|
await this.withNoMinTxsPerBlock(async () => {
|
|
535
506
|
const { txHash } = await mintBatch.send({
|
|
536
507
|
from: minter,
|
|
537
508
|
additionalScopes,
|
|
538
|
-
fee: { gasSettings: estimatedGas },
|
|
539
509
|
wait: NO_WAIT,
|
|
540
510
|
});
|
|
541
|
-
this.log.info(`Sent token mint tx with hash ${txHash.toString()}
|
|
511
|
+
this.log.info(`Sent token mint tx with hash ${txHash.toString()}`);
|
|
542
512
|
return waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds });
|
|
543
513
|
});
|
|
544
514
|
}
|