Complete the code to define a rollup type variable.
let rollupType = '[1]';
The variable rollupType should be set to Optimistic to represent an Optimistic Rollup.
Complete the code to check if a rollup uses zero-knowledge proofs.
if (rollupType === '[1]') { console.log('This rollup uses zero-knowledge proofs.'); }
The condition should check for ZK to identify zero-knowledge proof rollups.
Fix the error in the function that returns the rollup's verification method.
function getVerificationMethod(type) {
return type === '[1]' ? 'Fraud Proofs' : 'SNARKs';
}The function should check if the type is Optimistic to return 'Fraud Proofs'.
Fill both blanks to create a dictionary mapping rollup types to their verification methods.
const verificationMethods = {
Optimistic: '[1]',
ZK: '[2]'
};Optimistic rollups use Fraud Proofs, and ZK rollups use SNARKs for verification.
Fill all three blanks to filter rollups that use fraud proofs and map their names.
const rollups = [
{ name: 'Optimism', type: '[1]' },
{ name: 'Arbitrum', type: 'Optimistic' },
{ name: 'zkSync', type: 'ZK' }
];
const fraudProofRollups = rollups
.filter(r => r.type === '[2]')
.map(r => r.[3]);Both blanks 1 and 2 should be Optimistic to filter fraud proof rollups, and name is used to map their names.