Beginner FriendlyFoundryBridge
100 EXP
View results
Submission Details
Severity: high
Valid

Incorrect use of the `CREATE` opcode for ZKSync Era token deployment

Summary

Incorrect use of the CREATE opcode for ZKSync Era token deployment

Vulnerability Details

According to the README.md file in the Audit Scope Details, the project is planning to deploy the TokenFactory contract both to Ethereum mainnet and to ZKSync Era. But, on zkSync Era, contract deployment is performed using the hash of the bytecode, which means, that this TokenFactory code cannot be used per se. Please refer to this link for more information about this major difference between chains.

Impact

High. Deploying the same contract in both chains will result in an unusable TokenFactory in ZKSync Era.

Tools Used

  • Manual Review

Recommendations

Remove assembly code for token deployment in ZKSync TokenFactory contract:

function deployToken(string memory symbol) public onlyOwner returns (address addr) {
addr = address(new L1Token());
s_tokenToAddress[symbol] = addr;
emit TokenDeployed(symbol, addr);
}
Updates

Lead Judging Commences

0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

deployToken(): zksync compatibility issues

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.