-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: verified contracts v0.1 (#233)
also upgraded to aztec-packages 0.65.2
- Loading branch information
1 parent
2b66c9e
commit d38a74e
Showing
31 changed files
with
568 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
services/event-cannon/src/cannon/scenarios/simple-deploy-contract.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { DeploySentTx, waitForPXE } from "@aztec/aztec.js"; | ||
import { logger } from "../../logger.js"; | ||
import { getAztecNodeClient, getPxe, getWallets } from "../pxe.js"; | ||
import { deployContract } from "./utils/index.js"; | ||
import { EasyPrivateVotingContract } from "@aztec/noir-contracts.js"; | ||
import { | ||
ContractClassRegisteredEvent, | ||
ContractInstanceDeployedEvent, | ||
} from "@aztec/circuits.js"; | ||
import { ProtocolContractAddress } from "@aztec/protocol-contracts"; | ||
|
||
export async function run() { | ||
logger.info("===== SIMPLE DEPLOY CONTRACT ====="); | ||
const pxe = getPxe(); | ||
await waitForPXE(pxe); | ||
const namedWallets = getWallets(); | ||
|
||
const deployerWallet = namedWallets.alice; | ||
const votingAdmin = namedWallets.alice.getAddress(); | ||
|
||
const sentTx = EasyPrivateVotingContract.deploy( | ||
deployerWallet, | ||
votingAdmin | ||
).send(); | ||
|
||
await deployContract({ | ||
contractLoggingName: "Voting Contract", | ||
deployFn: (): DeploySentTx<EasyPrivateVotingContract> => sentTx, | ||
}); | ||
|
||
const blockNumber = (await sentTx.getReceipt()).blockNumber; | ||
const node = getAztecNodeClient(); | ||
if (blockNumber && blockNumber > 0) { | ||
const b = await node.getBlock(blockNumber); | ||
if (b) { | ||
const encryptedBlockLogs = b.body.txEffects.flatMap((txEffect) => | ||
txEffect.encryptedLogs.unrollLogs() | ||
); | ||
const contractInstances = | ||
ContractInstanceDeployedEvent.fromLogs(encryptedBlockLogs); | ||
|
||
const contractClassLogs = b.body.txEffects.flatMap((txEffect) => | ||
txEffect.contractClassLogs.unrollLogs() | ||
); | ||
const contractClasses = ContractClassRegisteredEvent.fromLogs( | ||
contractClassLogs, | ||
ProtocolContractAddress.ContractClassRegisterer | ||
); | ||
|
||
logger.info( | ||
JSON.stringify({ | ||
contractClasses, | ||
contractInstances, | ||
}) | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
436 changes: 218 additions & 218 deletions
436
...event-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...t-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json.bak
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
export const CHAIN_NAME = "AZTEC"; | ||
export const SERVICE_NAME = "explorer-api"; | ||
|
||
export const DEFAULT_VERIFIED_CONTRACT_ADDRESSES_DEV = [ | ||
"0x11a81043f8c2cb2e95fa28e051f042a87e76c9e42d442188638eb2c07ae445b2", // Account address added by Sandbox | ||
"0x17eafcd0961cc68c56b79305fa6fa8ee49bf8185b2bff279be84f3ceb1ae03ec", // Account address added by Sandbox | ||
"0x12fb76c6e2ccbad0919c554c07257fc69993ddd9c799c62179345b5b82a95dd8", // Account address added by Sandbox | ||
]; | ||
|
||
export const DEFAULT_VERIFIED_CONTRACT_ADDRESSES_PROD: string[] = [ | ||
// TODO: Add verified contract addresses for production | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.