DSS 2026 / Day 1 / Pearl Hall
The Big Smart Contract Security Quiz
Lothaire Aubergeon
Source: YouTube automatic caption track · Exported 2026-11-16. Timestamps link to the source video. Cue end times were not supplied.
Transcript
0:00Okay. So, good morning
0:03and welcome to um the big smart contract
0:05security quiz. Um so, it's more than a
0:09quiz. It's going to be a bit of a game
0:11show and for game show some contestants.
0:14So, um I have two of them with me. Um
0:16can you guys come up on stage and just
0:18very briefly introduce yourself?
0:21>> Thank you.
0:22>> Yeah. Hello. Um I'm Sergey. I'm solidity
0:25developer at LAR and uh partly I'm also
0:29a security researcher just like uh for
0:32the scope of LA course and smart
0:34contracts.
0:36>> Hello I'm Peter. I'm the lead protocol
0:39engineer at Spectra uh E derivatives
0:41protocol.
0:43>> Great thank you. Um so I'm going to
0:48explain briefly the the rules. You can
0:50join online on menty if you are in the
0:52room or online. Just if you're in the
0:54room, please add DSS to your name at the
0:57beginning. So I know who is in the room
0:58and who is not. Um because there will be
1:00a prize and I cannot give it to you
1:01obviously if you're online. So I called
1:04it a big quiz but we don't have too much
1:05time. So it's going to be only four
1:07rounds of solidity questions. Um and
1:09each of them is actually taken from a
1:12real finding we had in some chain
1:13security audits. So it's going to be
1:16slightly simplified and also anonymized
1:19but it's real stuff we found um for the
1:23people on stage. So the first to answer
1:25with a reason is going to raise their
1:27hands and by reason I mean you should at
1:29least at least try to explain what's
1:30going on in your mind. Um because there
1:33will be always like four possibilities
1:35and I don't want you to guess randomly
1:37right? So please just explain give your
1:38thoughts then we can discuss. Um, so
1:42online you will get like 30 seconds or
1:4345 seconds per question to to answer in
1:46the audience as well and there will be a
1:47prize for one of you and a price for one
1:49of you as well. Um, I hope everyone is
1:52online and uh let's get started. So we
1:59have a bunch of players.
2:02>> Okay. Yeah, that makes sense.
2:05Okay. So I think you guys should be uh
2:07should be on. Great. Um, yep. This is
2:12not what I was trying to do.
2:16Okay. Um, let's let's do it quickly. So,
2:20um, the first round is this uh this one.
2:23So, you have a revenue sharing protocol
2:25and it lets anyone register as a
2:27recipient. So, it could be an EOA, a
2:29multisig or contract. And this
2:32registration has this optional
2:34notification hook. And a fade
2:37notification must never block
2:38registration. Um, this is part of the
2:40specs.
2:41Um,
2:43yeah. Okay, let's just I'm going to give
2:44you 30 more seconds. Sorry.
2:47Okay, good. Uh, no, you can go ahead.
3:03>> The question changed. It did. Yeah. I'm
3:05sorry.
3:18Okay. Yeah, the first round is not not
3:19going to work. Um, so I'm sorry you
3:21didn't have enough time, but please take
3:23a look right now and try to think about
3:24the question and we'll just do the
3:26second one. Um, yeah.
3:30Do you guys have an idea?
3:43Also, you can come on this side if you
3:44want because it's maybe easier to read
3:46on the on the screen.
3:55>> Yeah. Yeah, that's good. That's good.
4:00So anything
4:05okay I'm sure it will go better for the
4:07next rounds if you guys have enough time
4:08to to look at it. Um so the answer was
4:11actually C and the transaction reverts.
4:14Um in the 30 seconds you had on the quiz
4:17without reading the question no one
4:19answered C. So um no one was lucky
4:21enough I guess. Um but let's let's go
4:24into it a bit. Um so what you should
4:27remember when you look at external high
4:29level solidity calls is that it's just
4:30not a call it's a pipeline. So you have
4:33multiple steps right the first one is
4:35that to you evaluate the arguments then
4:38there's this external code size check um
4:40so you might see where where this is
4:42going there's the encoding of the call
4:44data and then there's the call itself
4:46and then you decode whatever you receive
4:47from the call right and the try catch
4:50actually covers only one of those parts
4:51it covers only the call so all the other
4:54blocks they're doing in your frame so if
4:57there's a revert at this point it's just
4:59going to bubble up but it's not going to
5:01get caught by the try catch
5:03Um and that means in this situation that
5:05if you register plain EOA with no code,
5:08it would just revert during the external
5:10code size check. So answer D had
5:13something about solidity 0810. And some
5:16of you might remember that since 0810,
5:19the external code size check can
5:21actually be bypassed and skipped by the
5:24compiler, but only if you expect a
5:25return value. So let's say you had you
5:28add um a boolean boolean return to your
5:31interface then the external code check
5:33will be will be skipped but even then
5:36the try catch only covers the call and
5:38the decoding would fail because you
5:40expect a return value but you don't get
5:42one right so in both cases it will
5:44revert and um
5:47let's say that the EOA has an EIP7702
5:51delegation um can you guys think about
5:53what might happen this time if you have
5:55an idea
6:01So basically um it would work because
6:05the EIP772 it basically acts as it as if
6:08the EOA has code. So the external code
6:11size check um would work.
6:14So let's move to the second question.
6:17But there's a takeaway from this round.
6:18It's that basically try catch it
6:20protects the call but it doesn't protect
6:22the calling process. So you should be
6:24really careful when you use it. Um and
6:26this time hopefully you will get enough
6:29time to to answer the quiz. Uh but this
6:31is the second round. So you have this
6:33governance proxy which keeps pending
6:36changing um changes in a storage array.
6:38And the change can only be executed once
6:40its time lock has passed. And the queue
6:43right now um has like three changes X,
6:46Y, and Z in this order. Um X has passed
6:49its time lock but Z hasn't. And then a
6:52caller submits execute change for X for
6:54X. So they want to they want to execute
6:56X. The question is for which change is
7:00um execute call.
7:03So the sub function right
7:06and you still cannot answer.
7:10[laughter and gasps] Okay. Um
7:13well please do it in your in your heads.
7:14U the online quiz is kind of dead but
7:17I'm sure we'll get the the third round.
7:19So, we'll just give you give you a few
7:22seconds to think about it.
7:59I will say also we were supposed to have
8:01some like really nice quiz music but I
8:03guess there's no sound on the
8:04presentation so it might be a bit
8:05awkward but [laughter]
8:08think about it in your mind play it in
8:09your mind like some game show stressful
8:11music. Um
8:14yeah.
8:16Um so if the contestants has a have an
8:18idea, please. No idea.
8:23>> Same. No, sorry. [laughter]
8:25>> So it's again it's it's again a bit of a
8:27of a trick question, right? Because
8:28otherwise it's not fun. Um and the
8:31answer is actually that Z would be would
8:34be called um not X, right? And this is
8:38because if you look at it um so change
8:42is a storage variable and storage
8:44variables they point at they're pointers
8:47they point at the at the slot in storage
8:49right um that means that in this case if
8:54you look at it step by step so at first
8:56in change you put x right x because this
8:59is what what you want to call um in slot
9:02zero and then you have y and z the time
9:05check is done at this point so is going
9:07to pass because X is in your change
9:10variable storage variable and then you
9:12do a swap. So you just uh basically
9:16point
9:17Z to the storage variable
9:20and this is when um the execution is
9:23done. So basically you didn't change
9:25yourself the variable but um because
9:28it's it's a pointer Z is the one that's
9:31going to be called. Um, so basically
9:34that's the takeaway is that always a
9:36storage variable is a pointer. Its
9:38content can change even if you don't
9:39want it to change. So you should always
9:41be mindful of that. Um, and maybe use a
9:44memory variable or something like this.
9:46That would make your life slightly
9:48easier.
9:50Um, and let's move to the round three.
9:52And I swear this time you will get some
9:53time to participate. So the round three
9:56is is this. So you have smart wallets.
9:59um and they share reusable scripts which
10:01are deployed with create 2. So the
10:04registry first examines the
10:06deterministic address to check if we
10:09should redeploy or not. Um so you have
10:11like those three branches and we just
10:14check on the code hash see if there's
10:16already what we want there or something
10:18there. And the question is someone sends
10:21one way to the address first um and so
10:24what happens?
10:28Question three. Okay, this time you guys
10:30will get some time to do it. So, please
10:32you look at your devices.
11:07Okay. So, um we have two people who
11:10found the the answer. Um
11:15[laughter]
11:16>> um so a lot of people had um actually
11:18most people answered for C. It deploys
11:21um as expected. But yeah, I'm sorry this
11:24is not the case because otherwise it's
11:25not fun, right? Um, you guys might have
11:28an idea of what
11:29>> what is say it's not C.
11:31>> It is not C. It is not C. Yeah.
11:34[laughter]
11:35Um, so I mean I guess you you you were
11:39thinking about C because everything
11:40looks fine. Yeah. Yeah. For me that was
11:43the one of the use cases of this uh of
11:46the create 2 is to be able to preound an
11:48address. But I guess I missed something.
11:51Um so it's not really about create two.
11:53It's more about this specific cut
11:55snippet and um in particular
11:58you have like three cases right? Um so
12:00those three branches
12:02and the three cases are that so the
12:05address was never touched and in this
12:07case the code hash would be zero and
12:09then the deploy would work because you
12:10would end up in this branch. Um the
12:13second case is that so it's already been
12:16deployed it has the code hash you expect
12:18and then you just reuse it. So that's
12:20the second branch. And the third one is
12:22that actually when you send one way to
12:24an address, the code hash changes from
12:27zero to the hash of the empty value. Um
12:30and that's because an account was
12:32created and you have really those two
12:34separate states between no code no
12:36account and no code with an account. Um
12:38so if you do such checks, just be
12:41mindful that code hash zero doesn't
12:43necessarily mean um that it has no code
12:46only. It could be something else. And
12:49that's the takeaway. So cod hash zero
12:52means no account, but it's not the only
12:54cod hash that means no code. There are
12:56multiple of them. Um so good job to the
12:59two person who who found the answer. Um
13:02and let's move on to the last round. So
13:04you have this uh zero knowledge rollup
13:07uh settlement contract and it's running
13:09on this L2 with a 10 million block
13:11limit. So every roll of block appends
13:14exactly one hash to block hashes
13:17and nothing else you can assume
13:19everything is relatively cheap in terms
13:20of gas everything else in the function
13:22and also that block hashes is called at
13:25the start of each transaction
13:27and the question is after roughly how
13:29many rollup blocks does post block stop
13:32fitting in the L2 block. Um so there are
13:37your possible answers and please um
13:39answer on your devices.
13:48>> Yes.
14:30Okay,
14:32so most people answered D um which is
14:36that it would always fit because push is
14:3801 and I'm sorry but this is not correct
14:42um because again otherwise it wouldn't
14:44be fun, right? And for the three other
14:47answers, actually most people voted for
14:49two, which is the correct one. Um, so
14:53it's about 5,000 blocks.
14:56Um, maybe you guys have an idea of why?
15:00>> Me. No, sorry.
15:03>> You answer D. Yeah. I mean, it's it's
15:05what you would expect, right? Um,
15:06because obviously it looks uh it looks
15:08pretty right. But when you look at it a
15:11bit closer, you have three facts. The
15:13first one is that block hashes is in
15:16storage. Um, and storage is expensive to
15:18read from, right? But
15:22your viable hashes is in memory. So when
15:25you do this call, basically you always
15:27move everything from storage to memory.
15:29And by everything I mean the n um the n
15:32like hashes which were already in there.
15:35So if you do the the maths, um you have
15:37block hashes in storage, you have your
15:39hashes in memory, and each load is 2,100
15:42g.
15:44So end times at every call. So that
15:46means that the more hashes you add, the
15:48more expensive this gets. And at some
15:50points, it's going to um go above the 10
15:53million block limit. So again, this is a
15:56real case we found um and the chain
15:58would basically just hold after 10
16:00million blockage limit. So, it's
16:03approximately 4,760 blocks, if you do
16:06the maths, or 5,000. Um,
16:09and um, yeah, good job to the three
16:12people who found it. Um, and the
16:13takeaway from this is that yeah, storage
16:16to memory is a copy every single time.
16:18So, it can get expensive very quickly.
16:20Um, and you guys should always be
16:22mindful of this. So, let's take a look
16:26at who managed to answer correctly. Um
16:29the tool has questions or maybe by lock
16:31the first one. Um and it's actually
16:35so Nicolaus
16:37if he's in the room.
16:40He was probably online. Um we have
16:43Embryo in second position.
16:47Maverick
16:49Puffy Barefoot Contessa.
16:52Okay, so it's only online people guys.
16:54Um [laughter]
16:56I'm sorry. I guess um if you see me
16:59someday at Defcon or somewhere, please
17:02come to me. I will I will try to give
17:03you a prize. Um
17:06but yeah, thank you guys for coming. If
17:07you have any questions, um please let me
17:10know. And also, I apologize for the the
17:13mess with the the online quiz. Um it's
17:15always like this, but I tried my best.
17:17At least you guys had the two last
17:19questions. Um and uh thank you
17:23[applause]
17:24Any
17:32questions?
17:34I tried my best to explain the
17:36questions. So hopefully you should uh
17:37you should not have any questions,
17:38right?
17:39But please feel free to come to me
17:41afterwards if you do.
Source and accuracy details
- Names, organizations, technical terms, code and numbers may be misrecognized.
- Source wording and disfluencies are preserved; no editorial corrections were applied.
- Export contains whole-second cue starts only; cue ends and subsecond timing are unavailable.
- A full caption-track export does not establish that every spoken word is represented.
- Automatic YouTube captions; not human-verified against the audio.
Source export SHA256: 74cef5546b3c92da6555b0559b2779784004f09c3c64a4e90ca7b747b58cdd2e