{"componentChunkName":"component---src-pages-sips-sip-markdown-remark-frontmatter-sip-tsx","path":"/sips/sip-182/","result":{"data":{"markdownRemark":{"fileAbsolutePath":"/vercel/path0/content/sips/sip-182.md","frontmatter":{"sip":182,"sccp":null,"title":"Wrappr Factory","network":"Ethereum","author":"Mark E. Barrasso (@barrasso), Daniel Beal (@dbeal-eth)","type":"Governance","proposal":"https://snapshot.org/#/snxgov.eth/proposal/Qmf4yDwZMknKp2zKpNmsbDNnu7P5GCCsZgCQt2wzdTHd26","implementor":null,"release":null,"created":"2021-09-01T00:00:00.000Z","updated":null,"status":"Implemented"},"html":"<!--You can leave these HTML comments in your merged SIP and delete the visible duplicate text guides, they will not appear and may be helpful to refer to if you edit it again. This is the suggested template for new SIPs. Note that an SIP number will be assigned by an editor. When opening a pull request to submit your SIP, please use an abbreviated title in the filename, `sip-draft_title_abbrev.md`. The title should be 44 characters or less.-->\n<h2 id=\"implementors\" style=\"position:relative;\"><a href=\"#implementors\" aria-label=\"implementors permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Implementors</h2>\n<p>Mark E. Barrasso (@barrasso), Daniel Beal (@KillerByte)</p>\n<h2 id=\"simple-summary\" style=\"position:relative;\"><a href=\"#simple-summary\" aria-label=\"simple summary permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Simple Summary</h2>\n<p>Allows users to wrap any ERC20 token and mint its synthetic counterpart</p>\n<h2 id=\"abstract\" style=\"position:relative;\"><a href=\"#abstract\" aria-label=\"abstract permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Abstract</h2>\n<!--A short (~200 word) description of the proposed change, the abstract should clearly describe the proposed change. This is what *will* be done if the SIP is implemented, not *why* it should be done or *how* it will be done. If the SIP proposes deploying a new contract, write, \"we propose to deploy a new contract that will do x\".-->\n<p>This SIP proposes to create a new <code>WrapperFactory</code> contract that can deploy new <code>Wrapper</code> contracts to support virtually any ERC20 token. The new <code>Wrapper</code> contract behaves just like its predecessor, the <code>ETH Wrappr</code> from <a href=\"/6245eb2f9292c918540e4411a19a3eec/sip-112.md\">SIP-112</a>.</p>\n<h2 id=\"motivation\" style=\"position:relative;\"><a href=\"#motivation\" aria-label=\"motivation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Motivation</h2>\n<p>With respect to adding support for more token wrappers, this SIP proposes a new abstract factory contract that can deploy new wrappers as needed rather than creating another distinct SIP and contract for each new token to be added in the future.</p>\n<h2 id=\"specification\" style=\"position:relative;\"><a href=\"#specification\" aria-label=\"specification permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Specification</h2>\n<!--The specification should describe the syntax and semantics of any new feature, there are five sections\n1. Overview\n2. Rationale\n3. Technical Specification\n4. Test Cases\n5. Configurable Values\n-->\n<h3 id=\"overview\" style=\"position:relative;\"><a href=\"#overview\" aria-label=\"overview permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Overview</h3>\n<!--This is a high level overview of *how* the SIP will solve the problem. The overview should clearly describe how the new feature will be implemented.-->\n<p>A new contract is created, <code>WrapperFactory</code>, which deploys <code>Wrapper</code> instances. Before a new <code>Wrapper</code> instance can be deployed, it must first be approved via SIP. A synthetic token is minted whenever a user deposits a supported ERC20 token into its respective <code>Wrapper</code>. The user can deposit any amount desired however, this is subject to not exceeding the <code>maxTokenAmount</code>, which is configurable via SCCP. There is no duration, interest rate or collateralization ratio, as any user can at any time buy back the ERC20 token available in the contract by burning the synthetic token. SNX stakers benefit as minting and burning are subject to a <code>mintingFeeRate</code> and <code>burningFeeRate</code>, both of which are paid to the fee pool after conversion into sUSD. The <code>WrapperFactory</code> contract supports wrapper deployment for virtually any ERC20 token, and <code>Wrapper</code> automatically handles wrapping/unwrapping of the token for the user.</p>\n<h3 id=\"rationale\" style=\"position:relative;\"><a href=\"#rationale\" aria-label=\"rationale permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Rationale</h3>\n<!--This is where you explain the reasoning behind how you propose to solve the problem. Why did you propose to implement the change in this way, what were the considerations and trade-offs. The rationale fleshes out what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.-->\n<p>This SIP makes it easier to deploy <code>Wrapper</code> contracts that can support more assets in the future and will help expand the total supply of synths.</p>\n<h3 id=\"technical-specification\" style=\"position:relative;\"><a href=\"#technical-specification\" aria-label=\"technical specification permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Technical Specification</h3>\n<!--The technical specification should outline the public API of the changes proposed. That is, changes to any of the interfaces Synthetix currently exposes or the creations of new ones.-->\n<h4 id=\"wrapperfactory\" style=\"position:relative;\"><a href=\"#wrapperfactory\" aria-label=\"wrapperfactory permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>WrapperFactory</h4>\n<p>A new Synthetix core contract is created, <code>WrapperFactory</code>, which by means of the factory pattern deploys <code>Wrapper</code> instances using <code>createWrapper</code>. The <code>WrapperFactory</code> assumes functionality previously exposed by <code>EtherWrapper</code>.</p>\n<p>Specifically, <code>WrapperFactory</code> contains the following functions:</p>\n<ul>\n<li><code>createWrapper(IERC20 token, bytes32 currencyKey, bytes32 synthContractName)</code>\n<ul>\n<li>Allows <code>owner</code> to create <code>Wrapper</code> contracts. <code>token</code> and <code>currencyKey</code> indicate which token and synth should be wrapped, and <code>synthContractName</code> is included because concatenation of <code>bytes32</code> strings within solidity is difficult, and should match the <code>AddressResolver</code> name of the contract for <code>currencyKey</code>.</li>\n</ul>\n</li>\n<li><code>isWrapper(address possibleWrapper) returns (bool)</code>\n<ul>\n<li>Allows Synthetix system components to verify a valid Wrapper contract by passing contract address. Returns boolean, indicating if its a Wrapper contract or not</li>\n</ul>\n</li>\n<li><code>distributeFees()</code>\n<ul>\n<li>Assumes functionality of <code>EtherWrapper.distributeFees</code>, sending fees to the fee pool and informing of status</li>\n<li><em>note small change in functionality</em> fees are returned from sUSD instead of source currency keys. This means there is no debt hedging, but much easier to develop code for</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"wrapper\" style=\"position:relative;\"><a href=\"#wrapper\" aria-label=\"wrapper permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Wrapper</h4>\n<p>The Wrapper created by the factory should be functionally equivalent to <a href=\"/6245eb2f9292c918540e4411a19a3eec/sip-112.md\">SIP-112</a>, with the following exceptions:</p>\n<ul>\n<li>Constructor accepts IERC20 token address <code>token</code> of source token, and currency key <code>currencyKey</code> of target synth</li>\n<li><code>sETHIssued</code> renamed to <code>synthIssued</code></li>\n<li><code>maxETH</code> renamed to <code>maxTokenAmount</code></li>\n<li><code>SystemSettings</code> values have additional <code>wrapperAddress</code> argument to match</li>\n<li>Upon <code>_mint</code> or <code>_burn</code>, equivalent value sUSD is minted into the <code>WrapperFactory</code> contract instead of withholding <code>sETH</code>. This is functionally different in that fees are held as <code>sUSD</code> instead of their matching synth, meaning there is no hedging for the period of time before synth distribution.</li>\n<li><code>distributeFees</code> removed</li>\n</ul>\n<p><code>EtherWrapper</code> and <code>NativeEtherWrapper</code> are deprecated.</p>\n<h4 id=\"debtcache\" style=\"position:relative;\"><a href=\"#debtcache\" aria-label=\"debtcache permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>DebtCache</h4>\n<p>In order to optimize for gas usage and improve gas calculation</p>\n<p>The new functions are added:</p>\n<ul>\n<li><code>recordExcludedDebtChange(bytes32 currencyKey, int256 delta) external</code>\n<ul>\n<li>only callable by \"Debt issuers\" (which for now is just <code>Wrapper</code> instances)</li>\n<li>updates the <code>excludedDebt</code> entry for</li>\n<li>for this function to work properly it is critical that all debt changes for reporters be reported here</li>\n</ul>\n</li>\n<li><code>excludedIssuedDebts(bytes32[] memory currencyKeys) external view returns (uint256[])</code>\n<ul>\n<li>returns excludedIssuedDebt values for supplied currencyKeys</li>\n</ul>\n</li>\n<li><code>takeDebtSnapshot()</code>\n<ul>\n<li>modified to subtract <code>excludedDebt</code> entries from its total debt calculation</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"systemsettings\" style=\"position:relative;\"><a href=\"#systemsettings\" aria-label=\"systemsettings permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>SystemSettings</h4>\n<p>External functions are added to match settings described in the <code>Configurable Values</code> section below. Of particular note, the <code>mintRate</code> and <code>burnRate</code>\nconfigurabale params will now have the ability to specify a negative value (type will be <code>int256</code> instead of <code>uint256</code>), effectively incentivising rapid burn or minting of debt if the situation\ncalls for the need. If <code>mintRate</code> is set to -0.5, for example, the user will receive 0.5% more sETH than the ETH they put in. The reverse is true for <code>burnRate</code>--\nthe user will receive 0.5% more ETH when they burn the corresponding amount of sETH.</p>\n<h4 id=\"special-concerns\" style=\"position:relative;\"><a href=\"#special-concerns\" aria-label=\"special concerns permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Special Concerns</h4>\n<p>It is possible that the <code>SystemSettings</code> contract will not fit on L2.</p>\n<h3 id=\"test-cases\" style=\"position:relative;\"><a href=\"#test-cases\" aria-label=\"test cases permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Test Cases</h3>\n<!--Test cases for an implementation are mandatory for SIPs but can be included with the implementation..-->\n<p>Wrapper initialized with WETH -> sETH</p>\n<ul>\n<li>\n<p>Given that a user has <code>e</code> amount of ETH and <code>ew</code> WETH and the contract has <code>c</code> amount of ETH in spare capacity</p>\n<ul>\n<li>Given that <code>ew</code> is larger than or equal to <code>c</code>\n<ul>\n<li>When the user attempts to deposit <code>e</code> ETH into the contract\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>c</code> ETH is wrapped into WETH and is locked in the contract</li>\n<li><code>c(1-mintFeeRate)</code> is minted into the user's wallet in sETH</li>\n<li><code>c*mintFeeRate</code> worth of sETH is sent to the fee pool in the form of sUSD</li>\n<li><code>u - c</code> worth of ETH is refunded back to the user</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>When the user attempts to deposit <code>ew</code> WETH into the contract\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>c</code> WETH is locked up in the contract</li>\n<li><code>c(1-mintFeeRate)</code> is minted into the user's wallet in sETH</li>\n<li><code>c*mintFeeRate</code> worth of sETH is sent to the fee pool in the form of sUSD</li>\n<li><code>u - c</code> worth of WETH is refunded back to the user</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Given that <code>mintFeeRate</code> is &#x3C;0\n<ul>\n<li>When the user attempts to deposit <code>ew</code> WETH into the contract\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>c(1-mintFeeRate)</code> WETH is locked up in the contract</li>\n<li><code>c</code> is minted into the user's wallet in sETH</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Given that <code>u</code> is strictly lower than <code>c</code>\n<ul>\n<li>When the user attempts to deposit <code>e</code> ETH into the contract\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>u</code> ETH is wrapped into WETH and is locked in the contract</li>\n<li><code>u(1-mintFeeRate)</code> is minted into the user's wallet in sETH</li>\n<li><code>u*mintFeeRate</code> worth of sETH is sent to the fee pool in the form of sUSD</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>When the user attempts to deposit <code>ew</code> WETH into the contract\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>u</code> WETH is locked up in the contract</li>\n<li><code>u(1-mintFeeRate)</code> is minted into the user's wallet in sETH</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Given that <code>mintFeeRate</code> is &#x3C;0\n<ul>\n<li>When the user attempts to deposit <code>ew</code> WETH into the contract\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>u(1-mintFeeRate)</code> WETH is locked up in the contract</li>\n<li><code>u</code> is minted into the user's wallet in sETH</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>\n<p>Given that the contract's capacity is zero, as <code>maxETH</code> is locked in the contract</p>\n<ul>\n<li>When the user attempts deposit ETH or WETH into the contract\n<ul>\n<li>❌ Then the transaction reverts due to max capacity being reached</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>\n<p>Given that a user has <code>u</code> amount of sETH and the contract holds <code>c</code> amount of WETH</p>\n<ul>\n<li>Given that <code>u</code> is larger than or equal to <code>c(1+burnFeeRate)</code>\n<ul>\n<li>When the user attempts to draw out ETH from the contract by burning <code>u</code> sETH and flagging withdrawal in ETH\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>c</code> WETH is unwrapped to ETH and is sent to the user</li>\n<li><code>c</code> sETH is burned</li>\n<li><code>c * burnFeeRate</code> worth of sETH is swapped to sUSD and sent to the fee pool</li>\n<li><code>u - c(1+burnFeeRate)</code> worth of sETH is refunded back to the user</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>When the user attempts to draw out WETH from the contract by burning <code>u</code> sETH and flagging withdrawal in WETH\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>c</code> WETH is sent to the user</li>\n<li><code>c</code> sETH is burned</li>\n<li><code>c * burnFeeRate</code> worth of sETH is swapped to sUSD and sent to the fee pool</li>\n<li><code>u - c(1+burnFeeRate)</code> worth of sETH is refunded back to the user</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Given that <code>burnFeeRate</code> is &#x3C;0\n<ul>\n<li>When the user attempts to draw out WETH from the contract by burning <code>u</code> sETH and flagging withdrawal in WETH\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>c</code> WETH is sent to the user</li>\n<li><code>c</code> sETH is burned</li>\n<li><code>u + c(1+burnFeeRate)</code> worth of sETH is refunded back to the user</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Given that <code>u</code> is strictly lower than <code>c(1+burnFeeRate)</code>\n<ul>\n<li>When the user attempts to draw out ETH from the contract by burning <code>u</code> sETH and flagging withdrawal in ETH\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>u (1-burnFeeRate)</code> worth of WETH is unwrapped to ETH and is sent to the user</li>\n<li><code>u * burnFeeRate</code> worth of sETH is swapped to sUSD and sent to the fee pool</li>\n<li><code>u (1 - burnFeeRate)</code> sETH is burned</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>When the user attempts to draw out WETH from the contract by burning <code>u</code> sETH and flagging withdrawal in WETH\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>u (1-burnFeeRate)</code> worth of WETH is sent to the user</li>\n<li><code>u * burnFeeRate</code> worth of sETH is swapped to sUSD and sent to the fee pool</li>\n<li><code>u (1 - burnFeeRate)</code> sETH is burned</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Given that <code>burnFeeRate</code> is &#x3C;0\n<ul>\n<li>When the user attempts to draw out WETH from the contract by burning <code>u</code> sETH and flagging withdrawal in WETH\n<ul>\n<li>✅ Then it succeeds and the following take place:\n<ul>\n<li><code>u (1+burnFeeRate)</code> worth of WETH is sent to the user</li>\n<li><code>u 1</code> sETH is burned</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>\n<p>Given that the contract's holds no WETH</p>\n<ul>\n<li>When the user attempts draw out ETH or WETH from the contract\n<ul>\n<li>❌ Then the transaction reverts due to the contract being out of WETH</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>\n<p>Given that a user attemps to mint with <code>WETH</code> and <code>msg.value</code> is greater than zero then the following takes place:</p>\n<ul>\n<li>❌ The transaction reverts due to the user minting with both <code>WETH</code> and <code>ETH</code></li>\n</ul>\n</li>\n</ul>\n<h3 id=\"configurable-values-via-sccp\" style=\"position:relative;\"><a href=\"#configurable-values-via-sccp\" aria-label=\"configurable values via sccp permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Configurable Values (Via SCCP)</h3>\n<!--Please list all values configurable via SCCP under this implementation.-->\n<p>There are 3 new values for each Wrapper created by the WrapperFactory:</p>\n<table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Setter</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>wrapperMaxTokenAmount</code></td>\n<td><code>setWrapperMaxTokenAmount</code></td>\n<td>Maximum number of tokens in custody of the wrapper</td>\n</tr>\n<tr>\n<td><code>wrapperMintFeeRate</code></td>\n<td><code>setWrapperMintFeeRate</code></td>\n<td>Portion of synths after minting to be withheld for delivery to fee pool. This value may be negative.</td>\n</tr>\n<tr>\n<td><code>wrapperBurnFeeRate</code></td>\n<td><code>setWrapperBurnFeeRate</code></td>\n<td>Portion of synths prior to burning to be withheld for delivery to fee pool. This value may be negative.</td>\n</tr>\n</tbody>\n</table>\n<p>For all of the above parameters, the corresponding setter or getter function must be supplied with <code>wrapperAddress</code> to indicate which wrapper should be applied the setting.</p>\n<p>In addition, <code>etherWrapperMaxETH</code>, <code>etherWrapperMintFeeRate</code>, and <code>etherWrapperBurnFeeRate</code> are deprecated.</p>\n<h2 id=\"copyright\" style=\"position:relative;\"><a href=\"#copyright\" aria-label=\"copyright permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Copyright</h2>\n<p>Copyright and related rights waived via <a href=\"https://creativecommons.org/publicdomain/zero/1.0/\">CC0</a>.</p>"}},"pageContext":{"id":"3ff4618c-af10-57a0-b9b1-bb4ccf9c2ee8","frontmatter__sip":182,"__params":{"frontmatter__sip":"182"}}},"staticQueryHashes":[]}