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