diff --git a/docs/zkapps/o1js/index.mdx b/docs/zkapps/o1js/index.mdx index 573a20a25..b9852e691 100644 --- a/docs/zkapps/o1js/index.mdx +++ b/docs/zkapps/o1js/index.mdx @@ -60,7 +60,7 @@ Start your o1js journey by learning about [basic zk programming concepts](/zkapp ## Audits of o1js -* **Third-party audit (Q1/Q2 2024)**. An audit by an external security firm is ongoing and on track to complete in Q2 2024. Results will be shared when available. +* [**Veridise external audit (Q3 2024)**](https://github.com/o1-labs/o1js/blob/a09c5167c4df64f879684e5af14c59cf7a6fce11/audits/VAR_o1js_240318_o1js_V3.pdf). We engaged Veridise, a security auditing company, to do a full audit of o1js version 1. Veridise spent 39 person-weeks reviewing o1js in depth, and all issues of medium severity and higher were fixed. * [**Internal audit (Q1 2024)**](https://github.com/o1-labs/o1js/files/15192821/Internal.o1js.audit.Q1.2024.pdf). In March 2024, the o1js team spent roughly two person-weeks to conduct an internal audit of parts of the o1js code base. The audit focused on reviewing core provable code. A number of issues were found and fixed. diff --git a/docs/zkapps/writing-a-zkapp/feature-overview/upgradability.mdx b/docs/zkapps/writing-a-zkapp/feature-overview/upgradability.mdx index e2430b03e..84ddb544f 100644 --- a/docs/zkapps/writing-a-zkapp/feature-overview/upgradability.mdx +++ b/docs/zkapps/writing-a-zkapp/feature-overview/upgradability.mdx @@ -89,14 +89,11 @@ const contractAddress = zkAppKey.toPublicKey(); const upgradeTx = await Mina.transaction({ sender, fee }, async () => { const update = AccountUpdate.createSigned(contractAddress); - update.update.verificationKey = { - isSome: Bool(true), - value: verificationKey, - }; + update.account.verificationKey.set(verificationKey); } ); -await tx.sign([senderKey, zkAppKey]).prove(); -await tx.send(); +await upgradeTx.sign([senderKey, zkAppKey]).prove(); +await upgradeTx.send(); ``` And just like that, when the transaction is applied to the blockchain, the verification key at the ZkApp address will be updated from `"27729068461170601362912907281403262888852363473424470267835507636847418791713"` to `"18150279532259194644722165513074833862035641840431153413486908511595437348455"`! @@ -149,14 +146,11 @@ const contractAddress = zkAppKey.toPublicKey(); const upgradeTx = await Mina.transaction({ sender, fee }, async () => { const update = AccountUpdate.createSigned(contractAddress); - update.update.verificationKey = { - isSome: Bool(true), - value: verificationKey, - }; + update.account.verificationKey.set(verificationKey); } ); -await tx.sign([senderKey, zkAppKey]).prove(); -await tx.send(); +await upgradeTx.sign([senderKey, zkAppKey]).prove(); +await upgradeTx.send(); ``` ### State Variables diff --git a/examples/zkapps/feature-overview/src/upgradability/upgrade.test.ts b/examples/zkapps/feature-overview/src/upgradability/upgrade.test.ts index 96ea6263f..1faf90056 100644 --- a/examples/zkapps/feature-overview/src/upgradability/upgrade.test.ts +++ b/examples/zkapps/feature-overview/src/upgradability/upgrade.test.ts @@ -71,10 +71,7 @@ test('Initial contract data has correct state', async () => { tx = await Mina.transaction({ sender: feepayerAddress, fee }, async () => { const update = AccountUpdate.createSigned(zkApp.address); - update.update.verificationKey = { - isSome: Bool(true), - value: v2Contract.verificationKey, - }; + update.account.verificationKey.set(v2Contract.verificationKey); }); await tx.sign([senderKey, addKey]).prove(); await tx.send().wait(); @@ -100,10 +97,7 @@ test('Initial contract data has correct state', async () => { tx = await Mina.transaction({ sender: feepayerAddress, fee }, async () => { const update = AccountUpdate.createSigned(zkApp.address); - update.update.verificationKey = { - isSome: Bool(true), - value: v3Contract.verificationKey, - }; + update.account.verificationKey.set(v3Contract.verificationKey); }); await tx.sign([senderKey, addKey]).prove(); await tx.send().wait(); @@ -158,10 +152,7 @@ test('Initial contract data has correct state', async () => { tx = await Mina.transaction({ sender: feepayerAddress, fee }, async () => { const update = AccountUpdate.createSigned(unsafeAddAddress); - update.update.verificationKey = { - isSome: Bool(true), - value: v3ContractUnsafe.verificationKey, - }; + update.account.verificationKey.set(v3ContractUnsafe.verificationKey); }); await tx.sign([senderKey, unsafeZkAppAccount.key]).prove(); await tx.send().wait();