@@ -381,50 +381,51 @@ std::vector<std::optional<BuiltinFunctionForEVM>> createBuiltins(langutil::EVMVe
381
381
}
382
382
else // EOF context
383
383
{
384
- builtins.emplace_back (createFunction (
385
- " auxdataloadn" ,
386
- 1 ,
387
- 1 ,
388
- EVMDialect::sideEffectsOfInstruction (evmasm::Instruction::DATALOADN),
389
- ControlFlowSideEffects::fromInstruction (evmasm::Instruction::DATALOADN),
390
- {LiteralKind::Number},
391
- [](
392
- FunctionCall const & _call,
393
- AbstractAssembly& _assembly,
394
- BuiltinContext&
395
- ) {
396
- yulAssert (_call.arguments .size () == 1 );
397
- Literal const * literal = std::get_if<Literal>(&_call.arguments .front ());
398
- yulAssert (literal, " " );
399
- yulAssert (literal->value .value () <= std::numeric_limits<uint16_t >::max ());
400
- _assembly.appendAuxDataLoadN (static_cast <uint16_t >(literal->value .value ()));
401
- }
402
- ));
403
-
404
- builtins.emplace_back (createFunction (
405
- " eofcreate" ,
406
- 5 ,
407
- 1 ,
408
- EVMDialect::sideEffectsOfInstruction (evmasm::Instruction::EOFCREATE),
409
- ControlFlowSideEffects::fromInstruction (evmasm::Instruction::EOFCREATE),
410
- {LiteralKind::String, std::nullopt, std::nullopt, std::nullopt, std::nullopt},
411
- [](
412
- FunctionCall const & _call,
413
- AbstractAssembly& _assembly,
414
- BuiltinContext& context
415
- ) {
416
- yulAssert (_call.arguments .size () == 5 );
417
- Literal const * literal = std::get_if<Literal>(&_call.arguments .front ());
418
- auto const formattedLiteral = formatLiteral (*literal);
419
- yulAssert (!util::contains (formattedLiteral, ' .' ));
420
- auto const * containerID = valueOrNullptr (context.subIDs , formattedLiteral);
421
- yulAssert (containerID != nullptr );
422
- yulAssert (*containerID <= std::numeric_limits<AbstractAssembly::ContainerID>::max ());
423
- _assembly.appendEOFCreate (static_cast <AbstractAssembly::ContainerID>(*containerID));
424
- }
384
+ if (_objectAccess)
385
+ {
386
+ builtins.emplace_back (createFunction (
387
+ " auxdataloadn" ,
388
+ 1 ,
389
+ 1 ,
390
+ EVMDialect::sideEffectsOfInstruction (evmasm::Instruction::DATALOADN),
391
+ ControlFlowSideEffects::fromInstruction (evmasm::Instruction::DATALOADN),
392
+ {LiteralKind::Number},
393
+ [](
394
+ FunctionCall const & _call,
395
+ AbstractAssembly& _assembly,
396
+ BuiltinContext&
397
+ ) {
398
+ yulAssert (_call.arguments .size () == 1 );
399
+ Literal const * literal = std::get_if<Literal>(&_call.arguments .front ());
400
+ yulAssert (literal, " " );
401
+ yulAssert (literal->value .value () <= std::numeric_limits<uint16_t >::max ());
402
+ _assembly.appendAuxDataLoadN (static_cast <uint16_t >(literal->value .value ()));
403
+ }
425
404
));
426
405
427
- if (_objectAccess)
406
+ builtins.emplace_back (createFunction (
407
+ " eofcreate" ,
408
+ 5 ,
409
+ 1 ,
410
+ EVMDialect::sideEffectsOfInstruction (evmasm::Instruction::EOFCREATE),
411
+ ControlFlowSideEffects::fromInstruction (evmasm::Instruction::EOFCREATE),
412
+ {LiteralKind::String, std::nullopt, std::nullopt, std::nullopt, std::nullopt},
413
+ [](
414
+ FunctionCall const & _call,
415
+ AbstractAssembly& _assembly,
416
+ BuiltinContext& context
417
+ ) {
418
+ yulAssert (_call.arguments .size () == 5 );
419
+ Literal const * literal = std::get_if<Literal>(&_call.arguments .front ());
420
+ auto const formattedLiteral = formatLiteral (*literal);
421
+ yulAssert (!util::contains (formattedLiteral, ' .' ));
422
+ auto const * containerID = valueOrNullptr (context.subIDs , formattedLiteral);
423
+ yulAssert (containerID != nullptr );
424
+ yulAssert (*containerID <= std::numeric_limits<AbstractAssembly::ContainerID>::max ());
425
+ _assembly.appendEOFCreate (static_cast <AbstractAssembly::ContainerID>(*containerID));
426
+ }
427
+ ));
428
+
428
429
builtins.emplace_back (createFunction (
429
430
" returncontract" ,
430
431
3 ,
@@ -448,6 +449,7 @@ std::vector<std::optional<BuiltinFunctionForEVM>> createBuiltins(langutil::EVMVe
448
449
_assembly.appendReturnContract (static_cast <AbstractAssembly::ContainerID>(*containerID));
449
450
}
450
451
));
452
+ }
451
453
}
452
454
yulAssert (
453
455
ranges::all_of (builtins, [](std::optional<BuiltinFunctionForEVM> const & _builtinFunction){
0 commit comments