Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Verifier] Cannot verify yul contracts starting from solc v0.8.21 #934

Open
Tracked by #711
rimrakhimov opened this issue Jun 20, 2024 · 1 comment
Open
Tracked by #711
Assignees
Labels
bug Something isn't working

Comments

@rimrakhimov
Copy link
Member

Verification of yul contracts compiled with compilers greater or equal than solc v0.8.21 fails with internal server error. Logged error:

SerdeJson(Error("unknown variant `YulObject`, expected one of `Assignment`, `BinaryOperation`, `Conditional`, `ElementaryTypeNameExpression`, `FunctionCall`, `FunctionCallOptions`, `Identifier`, `IndexAccess`, `IndexRangeAccess`, `Literal`, `MemberAccess`, `NewExpression`, `TupleExpression`, `UnaryOperation`, `Block`, `Break`, `Continue`, `DoWhileStatement`, `EmitStatement`, `ExpressionStatement`, `ForStatement`, `IfStatement`, `InlineAssembly`, `PlaceholderStatement`, `Return`, `RevertStatement`, `TryStatement`, `UncheckedBlock`, `VariableDeclarationStatement`, `VariableDeclaration`, `WhileStatement`, `YulAssignment`, `YulBlock`, `YulBreak`, `YulContinue`, `YulExpressionStatement`, `YulLeave`, `YulForLoop`, `YulFunctionDefinition`, `YulIf`, `YulSwitch`, `YulVariableDeclaration`, `YulFunctionCall`, `YulIdentifier`, `YulLiteral`, `YulLiteralValue`, `YulHexValue`, `ContractDefinition`, `FunctionDefinition`, `EventDefinition`, `ErrorDefinition`, `ModifierDefinition`, `StructDefinition`, `EnumDefinition`, `UserDefinedValueTypeDefinition`, `PragmaDirective`, `ImportDirective`, `UsingForDirective`, `SourceUnit`, `InheritanceSpecifier`, `ElementaryTypeName`, `FunctionTypeName`, `ParameterList`, `TryCatchClause`, `ModifierInvocation`, `Other`", line: 1, column: 8791), ))

How to reproduce

https://eth-sepolia.blockscout.com/address/0x349B7Ac9681c8c88b2DED03828a50520CeCe7AD1

Should be verified with solc v0.8.26+commit.8a97fa7a, without any optimization, default evmVersion and following sources

object "Proxy" {
	// deployment code
	code {
		let size := datasize("runtime")
		datacopy(0, dataoffset("runtime"), size)
		return(0, size)
	}
	object "runtime" {
		// deployed code
		code {
			calldatacopy(0, 0, calldatasize())
			let result := create2(callvalue(), 0, calldatasize(), 0)
			if iszero(result) { revert(0, 0) }
			mstore(0, result)
			return(12, 20)
		}
	}
}
@rimrakhimov rimrakhimov mentioned this issue Jun 20, 2024
44 tasks
@rimrakhimov rimrakhimov self-assigned this Jun 20, 2024
@rimrakhimov
Copy link
Member Author

rimrakhimov commented Jun 21, 2024

Tried to remove the ast from outputSelection completely by not specifying it in file-level values. Didn't work due to ethereum/solidity#14452

@rimrakhimov rimrakhimov added the bug Something isn't working label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant