<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Antoni Pawlak</title>
    <description>The latest articles on DEV Community by Antoni Pawlak (@antooni).</description>
    <link>https://dev.to/antooni</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F812324%2Fece4ec59-9fe9-45ea-aaa5-2d1e18938f4d.jpeg</url>
      <title>DEV Community: Antoni Pawlak</title>
      <link>https://dev.to/antooni</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/antooni"/>
    <language>en</language>
    <item>
      <title>Starknet permissioned addresses</title>
      <dc:creator>Antoni Pawlak</dc:creator>
      <pubDate>Tue, 12 Jul 2022 11:23:58 +0000</pubDate>
      <link>https://dev.to/antooni/starknet-permissioned-addresses-5hgh</link>
      <guid>https://dev.to/antooni/starknet-permissioned-addresses-5hgh</guid>
      <description>&lt;h1&gt;
  
  
  &lt;a href="https://etherscan.io/address/0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4"&gt;Starknet core&lt;/a&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Who can upgrade implementation?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0xD5fB66CaEE881367Df4409B17Fd53a2Ef0D9B263"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who can &lt;code&gt;setProgramHash&lt;/code&gt;, &lt;code&gt;setConfigHash&lt;/code&gt;, &lt;code&gt;setMessageCancellationDelay&lt;/code&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0xD5fB66CaEE881367Df4409B17Fd53a2Ef0D9B263"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who can &lt;code&gt;updateState&lt;/code&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyOperator&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0x2c169dfe5fbba12957bdd0ba47d9cedbfe260ca7"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who can &lt;code&gt;registerOperator&lt;/code&gt; and &lt;code&gt;unregisterOperator&lt;/code&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0xD5fB66CaEE881367Df4409B17Fd53a2Ef0D9B263"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who manages governors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0xD5fB66CaEE881367Df4409B17Fd53a2Ef0D9B263"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://etherscan.io/address/0xae0Ee0A63A2cE6BaeEFFE56e7714FB4EFE48D419#code"&gt;ETH Bridge&lt;/a&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Who can upgrage implementation
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0x3DE55343499f59CEB3f1dE47F2Cd7Eab28F2F5C6"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who manages governors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0x3DE55343499f59CEB3f1dE47F2Cd7Eab28F2F5C6"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who can &lt;code&gt;setL2TokenBridge&lt;/code&gt;, &lt;code&gt;setMaxDeposit&lt;/code&gt;,
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0x3DE55343499f59CEB3f1dE47F2Cd7Eab28F2F5C6"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://etherscan.io/address/0x659a00c33263d9254Fed382dE81349426C795BB6"&gt;L1DaiBridge&lt;/a&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Who can &lt;code&gt;setCeiling&lt;/code&gt;, &lt;code&gt;setMaxDeposit&lt;/code&gt; and manage auth
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;auth&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0x0a3f6849f78076aefadf113f5bed87720274ddc0"&gt;MakerDAO&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://etherscan.io/address/0x0437465dfb5B79726e35F08559B0cBea55bb585C#code"&gt;L1Escrow&lt;/a&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Who can &lt;code&gt;approve&lt;/code&gt; token transfers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;auth&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0x0a3f6849f78076aefadf113f5bed87720274ddc0"&gt;MakerDAO&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>ImmutableX permissioned addresses</title>
      <dc:creator>Antoni Pawlak</dc:creator>
      <pubDate>Mon, 11 Jul 2022 11:08:03 +0000</pubDate>
      <link>https://dev.to/antooni/immutablex-permissioned-addresses-5blk</link>
      <guid>https://dev.to/antooni/immutablex-permissioned-addresses-5blk</guid>
      <description>&lt;h2&gt;
  
  
  &lt;a href="https://etherscan.io/address/0x5FDCCA53617f4d2b9134B29090C87D01058e27e9"&gt;Bridge&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Who can upgrade implementation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernace&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0x799Ec7ff0Bf9d8Bb4f3643aa85dA0971b1104B5a"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Who can &lt;code&gt;updateState()&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyOperator&lt;/code&gt; - &lt;a href="https://dev.to0x9B7f7d0d23d4CAce5A3157752D0D4e4bf25E927e"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Who manages operators and verifiers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernace&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0x799Ec7ff0Bf9d8Bb4f3643aa85dA0971b1104B5a"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://etherscan.io/address/0x16BA0f221664A5189cf2C1a7AF0d3AbFc70aA295"&gt;DAC Committee&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Who can upgrade implementation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;on one, contract is not a proxy&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Who can &lt;code&gt;verifyAvailabilityProof()&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;anyone, but it needs to be signed by at least 5 DAC members &lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;DAC members addresses&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0x1ffbdb8061b586a6d29fb608d025e5d8744f58d1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x24eeffc269bb8e540f5b2c8f45750489abf8d54b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x48af849535ddfa560a0eb0fbdef436688169b949&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0x51abde72a4542500a7b1cb32b18b13fbe1f9ff2e&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0xafc4589af46c72cbf550f2eeae38c97aede15d17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0xb71fc111d7ba82d5955baddd7717f3467184ff61&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0xff506616e8c53ee5e513b906ac00b5d76664c537&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://etherscan.io/address/0xa739b175325cca7b71fcb51c3032935ef7ac338f"&gt;STARK Verifier&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Who can upgrade implementation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://etherscan.io/address/0x3DE55343499f59CEB3f1dE47F2Cd7Eab28F2F5C6"&gt;EOA&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Who can &lt;code&gt;verifyProofAndRegister()&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;anyone, but the smartcontracts are guiding correctness&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>dYdX permissioned addresses</title>
      <dc:creator>Antoni Pawlak</dc:creator>
      <pubDate>Mon, 11 Jul 2022 10:33:23 +0000</pubDate>
      <link>https://dev.to/antooni/dydx-permissioned-addresses-3b7a</link>
      <guid>https://dev.to/antooni/dydx-permissioned-addresses-3b7a</guid>
      <description>&lt;h2&gt;
  
  
  &lt;a href="https://etherscan.io/address/0xD54f502e184B6B739d7D27a6410a67dc462D69c8"&gt;Bridge&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Who can upgrade the implementation?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://dev.to/antooni/dydx-governance-mechanism-3mp7"&gt;Governance Contract&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What are the implications?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;code can be substituted with arbitrary code which in the worst case scenario means your funds can be stolen&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Who can update state?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyOperator&lt;/code&gt; - &lt;a href="https://dev.to0x8129b737912e17212C8693B781928f5D0303390a"&gt;EOA&lt;/a&gt; designated by governance&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Who manages verifiers and operators
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://dev.to/antooni/dydx-governance-mechanism-3mp7"&gt;Governance Contract&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://etherscan.io/address/0xC8c212f11f6ACca77A7afeB7282dEBa5530eb46C"&gt;GPS Statement Verifier&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Who can upgrade the implementation?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onlyGovernance&lt;/code&gt; - &lt;a href="https://dev.to0x3DE55343499f59CEB3f1dE47F2Cd7Eab28F2F5C6"&gt;EOA&lt;/a&gt; in this case it is EOA, I wonder why they haven't used governance mechanism here also&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What are the implications?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;implementation can be upgraded so the method &lt;code&gt;verifyProofAndRegsiter()&lt;/code&gt; can return true every time which means that the fraudulent state can be commited to the rollup&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://etherscan.io/address/0xEfbCcE4659db72eC6897F46783303708cf9ACef8"&gt;Memory Page Fact Registry&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Who can upgrade implementation?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;no one, contract is not upgradable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Who can &lt;code&gt;registerContinuousMemoryPage()&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;anyone, method is public &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://etherscan.io/address/0xf6b83CcaDeee478FC372AF6ca7069b14FBc5E1B1"&gt;FRI Statement&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Who can upgrade implementation?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;no one, contract is not upgradable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Who can &lt;code&gt;verifyFRI()&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;anyone, method is public &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://etherscan.io/address/0x0d62bac5c346c78DC1b27107CAbC5F4DE057a830"&gt;Merkle Statement&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Who can upgrade implementation?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;no one, contract is not upgradable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Who can &lt;code&gt;verifyMerkle()&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;anyone, method is public &lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;We can clearly see that current dYdX implementation is far from being decentralised&lt;/p&gt;

</description>
    </item>
    <item>
      <title>dYdX Governance Mechanism</title>
      <dc:creator>Antoni Pawlak</dc:creator>
      <pubDate>Tue, 05 Jul 2022 15:08:09 +0000</pubDate>
      <link>https://dev.to/antooni/dydx-governance-mechanism-3mp7</link>
      <guid>https://dev.to/antooni/dydx-governance-mechanism-3mp7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Who controls dYdX bridge ?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Ownership
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;dYdX Bridge&lt;/strong&gt; is a &lt;a href="https://etherscan.deth.net/address/0xD54f502e184B6B739d7D27a6410a67dc462D69c8#readContract"&gt;Proxy&lt;/a&gt; &lt;a href="https://etherscan.io/address/0xD54f502e184B6B739d7D27a6410a67dc462D69c8"&gt;0xd54f...&lt;/a&gt; 
can be upgraded via &lt;code&gt;upgradeTo(...) onlyGovernance&lt;/code&gt; method &lt;/li&gt;
&lt;li&gt;Current governor is &lt;a href="https://etherscan.deth.net/address/0xfcaac0f14dea11ede11afcb875f29130e1ad5ec0#code"&gt;StarkExRemoverGovernorV2&lt;/a&gt; &lt;a href="https://dev.to0xfcaac0f14dea11ede11afcb875f29130e1ad5ec0"&gt;0xfcaa...&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Admin of StarkExRemoverGovernorV2 is &lt;a href="https://etherscan.deth.net/address/0xa306989ba6bcacdeccf3c0614fff2b8c668e3cae#code"&gt;PriorityExecutor&lt;/a&gt; &lt;a href="https://etherscan.io/address/0xa306989ba6bcacdeccf3c0614fff2b8c668e3cae"&gt;0xa306...&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Admin of PriorityExecutor is &lt;a href="https://etherscan.deth.net/address/0x7e9b1672616ff6d6629ef2879419aae79a9018d2#code"&gt;DydxGovernor&lt;/a&gt; &lt;a href="https://etherscan.io/address/0x7e9b1672616ff6d6629ef2879419aae79a9018d2"&gt;0x7e9b...&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Current governance strategy is &lt;a href="https://etherscan.deth.net/address/0x90dfd35f4a0bb2d30cdf66508085e33c353475d9"&gt;GovernanceStrategy&lt;/a&gt; &lt;a href="https://etherscan.io/address/0x90dfd35f4a0bb2d30cdf66508085e33c353475d9"&gt;0x90df&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Logic
&lt;/h2&gt;

&lt;p&gt;voting power is held by &lt;strong&gt;dydx token owners&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;the proposal goes through stages &lt;code&gt;Pending =&amp;gt; Active =&amp;gt; Succeeded =&amp;gt; Queued =&amp;gt; Executed&lt;/code&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Proposal creation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="n"&gt;DydxGovernor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Requirements for creation
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="n"&gt;PriorityExecutor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;validateCreatorOfProposal&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  What is being checked
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="n"&gt;GovernanceStrategy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getPropositionPowerAt&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;getMinimumPropositionPowerNeeded&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  getMinimumPropositionPowerNeeded()
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="n"&gt;GovernanceStrategy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getTotalPropositionSupplyAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blockNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mul&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PROPOSITION_THRESHOLD&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ONE_HUNDRED_WITH_PRECISION&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;//PROPOSITION_THRESHOLD = 50
//ONE_HUNDRED_WITH_PRECISION = 10000
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;current proposal threshold is 0.5%&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;so anyone with at least 0.5% of total supply of dydx token can create a proposal&lt;/p&gt;




&lt;h3&gt;
  
  
  Voting result
&lt;/h3&gt;

&lt;p&gt;voting succeeds when&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PriorityExecutor.isProposalPassed() &amp;amp;&amp;amp; executionTime = 0` 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it means the proposal was voted for by a majority and was not yet executed, now it can be enqueued for execution&lt;/p&gt;

&lt;h4&gt;
  
  
  What is being checked
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;isQuorumValid(governance, proposalId) &amp;amp;&amp;amp; isVoteDifferentialValid(governance, proposalId)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  isQuorumValid
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;proposal.forVotes &amp;gt;= getMinimumVotingPowerNeeded(votingSupply)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  getMinimumVotingPowerNeeded()
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;votingSupply.mul(MINIMUM_QUORUM).div(ONE_HUNDRED_WITH_PRECISION)
//MINIMUM_QUORUM=200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;current minimum quorum is 2%&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h5&gt;
  
  
  isVoteDifferentialValid
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="n"&gt;proposal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forVotes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mul&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ONE_HUNDRED_WITH_PRECISION&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;votingSupply&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;proposal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;againstVotes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mul&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ONE_HUNDRED_WITH_PRECISION&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;votingSupply&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;VOTE_DIFFERENTIAL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;//VOTE_DIFFERENTIAL=50
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;current VOTE_DIFFERENTIAL is 0.5%&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Execution
&lt;/h3&gt;

&lt;p&gt;when the vote succeeds it can be executed by executor&lt;/p&gt;




&lt;h2&gt;
  
  
  dydx token
&lt;/h2&gt;

&lt;p&gt;The token contract is at &lt;a href="https://etherscan.io/address/0x92d6c1e31e14520e676a687f0a93788b716beff5"&gt;0x92d5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Current total supply is &lt;strong&gt;1,000,000,000&lt;/strong&gt;&lt;br&gt;
Minimum amount to create proposal is &lt;strong&gt;5,000,000&lt;/strong&gt;&lt;br&gt;
Minimum quorum is &lt;strong&gt;20,000,000&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GQksC5Pc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r9ohxti4ib2282xy3q5u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GQksC5Pc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r9ohxti4ib2282xy3q5u.png" alt="dydx token info" width="689" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;there are: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;21 addresses who can create a proposal&lt;/li&gt;
&lt;li&gt;8 addresses that can singlehandedly push proposal (if no other address votes)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--USv23htq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7umd1w3qkt9m5na6oiwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--USv23htq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7umd1w3qkt9m5na6oiwy.png" alt="dydx whales" width="880" height="841"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>fallback() | Ethernaut #01:</title>
      <dc:creator>Antoni Pawlak</dc:creator>
      <pubDate>Thu, 30 Jun 2022 13:30:29 +0000</pubDate>
      <link>https://dev.to/antooni/fallback-ethernaut-1-2jg2</link>
      <guid>https://dev.to/antooni/fallback-ethernaut-1-2jg2</guid>
      <description>&lt;p&gt;What happens when you call the function that does not exist, or send ether to a contract via &lt;code&gt;send()&lt;/code&gt; or &lt;code&gt;transfer()&lt;/code&gt; ?&lt;/p&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yvroNU1_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5fxvbdpiek20rd5em9v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yvroNU1_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5fxvbdpiek20rd5em9v.png" alt="execution diagram" width="285" height="256"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;code&gt;fallback() external [payable] {...}&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;executes when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;function does not exist in contract&lt;/li&gt;
&lt;li&gt;ether transfer with non-empty call data&lt;/li&gt;
&lt;li&gt;ether transfer when there is no &lt;code&gt;receive()&lt;/code&gt; function&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;receive() external payable {...}&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;executes when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ether transfer with empty calldata&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Code example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="k"&gt;contract&lt;/span&gt; &lt;span class="n"&gt;TestPayable&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;external&lt;/span&gt; &lt;span class="k"&gt;payable&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;receive&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;external&lt;/span&gt; &lt;span class="k"&gt;payable&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;address(contract).transfer(AMOUNT)&lt;/code&gt; =&amp;gt; x=2&lt;br&gt;
&lt;code&gt;address(contract).call{value:1}(abi.encodePacked("SOME"))&lt;/code&gt; =&amp;gt; x=1&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-world usage: Proxy
&lt;/h2&gt;

&lt;p&gt;Let's look at the code of Proxy.sol&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jJiHqv5u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5hqkc7d7w8k8bggvwfm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jJiHqv5u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5hqkc7d7w8k8bggvwfm1.png" alt="Proxy code" width="799" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;proxy.foo(...)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;foo(...)&lt;/code&gt; does not exist in proxy's source code&lt;/li&gt;
&lt;li&gt;fallback is triggered&lt;/li&gt;
&lt;li&gt;make &lt;code&gt;delegatecall(...)&lt;/code&gt; on implementation&lt;/li&gt;
&lt;li&gt;return result&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thanks to fallback function arbitrary function can be called on a proxy. Without it we would have to create more complicated mechanism.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why &lt;code&gt;receive()&lt;/code&gt; was introduced?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To make explicit check if &lt;code&gt;msg.data&lt;/code&gt; is empty. Without it, it was up to the programmer to check whether calldata is empty. &lt;/li&gt;
&lt;li&gt;Better UX for plain ETH transfers, so the user who didn't put calldata could be handled independetly. &lt;code&gt;receive()&lt;/code&gt; function enforced on programmers thinking about such cases.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Ethernaut 01: Fallback
&lt;/h2&gt;

&lt;p&gt;There was a fallback method which granted you ownership if you contributed before and supplied some ether. This way your contribution could be less than owner but still you can gain ownership.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Interact with contract using &lt;a href="https://web3js.readthedocs.io/en/v1.2.11/index.html"&gt;web3.js&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Send ether when interacting with an ABI&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;contract.contribute({value: AMOUNT_IN_WEI})&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Send ether outside of the ABI &lt;a href="https://web3js.readthedocs.io/en/v1.2.11/web3-eth.html?highlight=sendTransaction#sendtransaction"&gt;docs&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;contract.sendTransaction({value: AMOUNT_IN_WEI})&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://ethernaut.openzeppelin.com/level/0x9CB391dbcD447E645D6Cb55dE6ca23164130D008"&gt;Level&lt;/a&gt; completed at &lt;a href="https://rinkeby.etherscan.io/tx/0xf5988d426eb0aab8e8cd9544e135e3b7a13a454db2ad5fc533afbd5a170900c6"&gt;tx&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;sources:&lt;br&gt;
&lt;a href="https://studygroup.moralis.io/t/fallback-function/45026/3"&gt;forum answer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/coinmonks/solidity-fundamentals-functions-a7e3d38c1fe5"&gt;medium blog post&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.soliditylang.org/en/v0.8.15/contracts.html?highlight=fallback#receive-ether-function"&gt;solidity docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ethereum.stackexchange.com/questions/81994/what-is-the-receive-keyword-in-solidity"&gt;stackexchange&lt;/a&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>blockchain</category>
      <category>ethereum</category>
      <category>evm</category>
    </item>
    <item>
      <title>Get hourly data from Coingecko API</title>
      <dc:creator>Antoni Pawlak</dc:creator>
      <pubDate>Wed, 09 Feb 2022 21:17:27 +0000</pubDate>
      <link>https://dev.to/antooni/get-hourly-data-from-coingecko-api-226f</link>
      <guid>https://dev.to/antooni/get-hourly-data-from-coingecko-api-226f</guid>
      <description>&lt;h2&gt;
  
  
  📋 Task
&lt;/h2&gt;

&lt;p&gt;Get hourly price data on an arbitrary time period from Coingecko API&lt;/p&gt;




&lt;h2&gt;
  
  
  🤯 Problem
&lt;/h2&gt;

&lt;p&gt;Hourly granularity is available only in 1-90 days span&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Solution
&lt;/h2&gt;

&lt;p&gt;Cut bigger time frames on multiple 90-day calls&lt;/p&gt;




&lt;h2&gt;
  
  
  ❓ How
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;await Promise.all() &lt;a href="https://www.aleksandrhovhannisyan.com/blog/javascript-promise-all/" rel="noopener noreferrer"&gt;decent blog post about it&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Create a method to call an API | &lt;a href="https://www.coingecko.com/en/api/documentation" rel="noopener noreferrer"&gt;docs&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fopfcb17pwhue3r8ma42z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fopfcb17pwhue3r8ma42z.png" alt="create a method to call an API"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Generate suitable time ranges
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fht5p9nms3590mh7xutlk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fht5p9nms3590mh7xutlk.png" alt="generate suitable time ranges"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Make multiple calls to an API
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjrt2jycq5xenesuyxi32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjrt2jycq5xenesuyxi32.png" alt="make multiple calls to an API"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;Have a nice day!&lt;/em&gt;&lt;/strong&gt; 🤓
&lt;/h2&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>web3</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
