[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"navigation":3,"\u002Fprotocol\u002Fextensions":260,"\u002Fprotocol\u002Fextensions-surround":1126},[4,22,105,148,177,186,243],{"title":5,"path":6,"stem":7,"children":8,"page":21},"Agents","\u002Fagents","agents",[9,13,17],{"title":10,"path":11,"stem":12},"LLMs.txt","\u002Fagents\u002Fllms-txt","agents\u002Fllms-txt",{"title":14,"path":15,"stem":16},"MCP Server","\u002Fagents\u002Fmcp-server","agents\u002Fmcp-server",{"title":18,"path":19,"stem":20},"Skills","\u002Fagents\u002Fskills","agents\u002Fskills",false,{"title":23,"path":24,"stem":25,"children":26,"page":21},"Api Reference","\u002Fapi-reference","api-reference",[27,31,35,68],{"title":28,"path":29,"stem":30},"Authentication","\u002Fapi-reference\u002Fauthentication","api-reference\u002Fauthentication",{"title":32,"path":33,"stem":34},"API Reference","\u002Fapi-reference\u002Fintroduction","api-reference\u002Fintroduction",{"title":36,"path":37,"stem":38,"children":39,"page":21},"Orchestration","\u002Fapi-reference\u002Forchestration","api-reference\u002Forchestration",[40,44,48,52,56,60,64],{"title":41,"path":42,"stem":43},"POST \u002Fcancel-order","\u002Fapi-reference\u002Forchestration\u002Fcancel-order","api-reference\u002Forchestration\u002Fcancel-order",{"title":45,"path":46,"stem":47},"GET \u002Forder-status\u002F{orderId}","\u002Fapi-reference\u002Forchestration\u002Forder-status","api-reference\u002Forchestration\u002Forder-status",{"title":49,"path":50,"stem":51},"GET \u002Forders","\u002Fapi-reference\u002Forchestration\u002Forders","api-reference\u002Forchestration\u002Forders",{"title":53,"path":54,"stem":55},"Orchestration API","\u002Fapi-reference\u002Forchestration\u002Foverview","api-reference\u002Forchestration\u002Foverview",{"title":57,"path":58,"stem":59},"POST \u002Fquote","\u002Fapi-reference\u002Forchestration\u002Fquote","api-reference\u002Forchestration\u002Fquote",{"title":61,"path":62,"stem":63},"GET \u002Fsupported-assets","\u002Fapi-reference\u002Forchestration\u002Fsupported-assets","api-reference\u002Forchestration\u002Fsupported-assets",{"title":65,"path":66,"stem":67},"TypeScript Type Generation","\u002Fapi-reference\u002Forchestration\u002Ftype-generation","api-reference\u002Forchestration\u002Ftype-generation",{"title":69,"path":70,"stem":71,"children":72,"page":21},"Recipes","\u002Fapi-reference\u002Frecipes","api-reference\u002Frecipes",[73,77,81,85,89,93,97,101],{"title":74,"path":75,"stem":76},"Collateral Composition","\u002Fapi-reference\u002Frecipes\u002Fcollateral-composition","api-reference\u002Frecipes\u002Fcollateral-composition",{"title":78,"path":79,"stem":80},"Daily Yields","\u002Fapi-reference\u002Frecipes\u002Fdaily-yields","api-reference\u002Frecipes\u002Fdaily-yields",{"title":82,"path":83,"stem":84},"Earner Rate History","\u002Fapi-reference\u002Frecipes\u002Fearner-rate-history","api-reference\u002Frecipes\u002Fearner-rate-history",{"title":86,"path":87,"stem":88},"Minter Daily Expenses","\u002Fapi-reference\u002Frecipes\u002Fminter-daily-expenses","api-reference\u002Frecipes\u002Fminter-daily-expenses",{"title":90,"path":91,"stem":92},"Network Supply","\u002Fapi-reference\u002Frecipes\u002Fnetwork-supply","api-reference\u002Frecipes\u002Fnetwork-supply",{"title":94,"path":95,"stem":96},"Protocol Configuration","\u002Fapi-reference\u002Frecipes\u002Fprotocol-config","api-reference\u002Frecipes\u002Fprotocol-config",{"title":98,"path":99,"stem":100},"Token Holders","\u002Fapi-reference\u002Frecipes\u002Ftoken-holders","api-reference\u002Frecipes\u002Ftoken-holders",{"title":102,"path":103,"stem":104},"Token Overview","\u002Fapi-reference\u002Frecipes\u002Ftoken-overview","api-reference\u002Frecipes\u002Ftoken-overview",{"title":106,"path":107,"stem":108,"children":109,"page":21},"Build","\u002Fbuild","build",[110,114,118,122,126,130,134,138,142,145],{"title":111,"path":112,"stem":113},"Integrating with the M0 Portals","\u002Fbuild\u002Fbridging-developer","build\u002Fbridging-developer",{"title":115,"path":116,"stem":117},"Bridging M And wM Tokens","\u002Fbuild\u002Fbridging-user","build\u002Fbridging-user",{"title":119,"path":120,"stem":121},"Stablecoin Extension Templates","\u002Fbuild\u002Fchoosing-your-model","build\u002Fchoosing-your-model",{"title":123,"path":124,"stem":125},"How to Design Your Stablecoin","\u002Fbuild\u002Foverview","build\u002Foverview",{"title":127,"path":128,"stem":129},"Implementation Guide: NoYield","\u002Fbuild\u002Fsvm-noyield-guide","build\u002Fsvm-noyield-guide",{"title":131,"path":132,"stem":133},"Getting started","\u002Fbuild\u002Fsvm-noyield-guide-overview","build\u002Fsvm-noyield-guide-overview",{"title":135,"path":136,"stem":137},"Implementation Guide: MYieldToOne (Onshore)","\u002Fbuild\u002Ftreasury-guide","build\u002Ftreasury-guide",{"title":139,"path":140,"stem":141},"Implementation Guide: JMI (Offshore)","\u002Fbuild\u002Ftreasury-jmi-guide","build\u002Ftreasury-jmi-guide",{"title":131,"path":143,"stem":144},"\u002Fbuild\u002Ftreasury-jmi-overview","build\u002Ftreasury-jmi-overview",{"title":131,"path":146,"stem":147},"\u002Fbuild\u002Ftreasury-model","build\u002Ftreasury-model",{"title":149,"path":150,"stem":151,"children":152,"page":21},"Get Started","\u002Fget-started","get-started",[153,157,161,165,169,173],{"title":154,"path":155,"stem":156},"Accessing Liquidity","\u002Fget-started\u002Faccessing-liquidity","get-started\u002Faccessing-liquidity",{"title":158,"path":159,"stem":160},"Cross Chain Interoperability","\u002Fget-started\u002Fcross-chain","get-started\u002Fcross-chain",{"title":162,"path":163,"stem":164},"Architecture Overview","\u002Fget-started\u002Fhow-it-works","get-started\u002Fhow-it-works",{"title":166,"path":167,"stem":168},"Overview","\u002Fget-started\u002Foverview","get-started\u002Foverview",{"title":170,"path":171,"stem":172},"Platform Mechanics & Reward Programmability","\u002Fget-started\u002Fprotocol-mechanics","get-started\u002Fprotocol-mechanics",{"title":174,"path":175,"stem":176},"Stablecoin Features","\u002Fget-started\u002Fstablecoin-features","get-started\u002Fstablecoin-features",{"title":178,"path":179,"stem":180,"children":181,"page":21},"Issuers","\u002Fissuers","issuers",[182],{"title":183,"path":184,"stem":185},"Issue Your Stablecoin","\u002Fissuers\u002Foverview","issuers\u002Foverview",{"title":187,"path":188,"stem":189,"children":190,"page":21},"Protocol","\u002Fprotocol","protocol",[191,195,199,203,207,211,215,219,223,227,231,235,239],{"title":192,"path":193,"stem":194},"Distribution Vault","\u002Fprotocol\u002Fdistribution-vault","protocol\u002Fdistribution-vault",{"title":196,"path":197,"stem":198},"M0 Extensions","\u002Fprotocol\u002Fextensions","protocol\u002Fextensions",{"title":200,"path":201,"stem":202},"Limit Order Protocol","\u002Fprotocol\u002Flimit-order-protocol","protocol\u002Flimit-order-protocol",{"title":204,"path":205,"stem":206},"M0 Portals","\u002Fprotocol\u002Fm-portals","protocol\u002Fm-portals",{"title":208,"path":209,"stem":210},"M Token","\u002Fprotocol\u002Fm-token","protocol\u002Fm-token",{"title":212,"path":213,"stem":214},"M Token Specification","\u002Fprotocol\u002Fm-token-spec","protocol\u002Fm-token-spec",{"title":216,"path":217,"stem":218},"Minting & Burning (MinterGateway)","\u002Fprotocol\u002Fminting-burning","protocol\u002Fminting-burning",{"title":220,"path":221,"stem":222},"Portal V2","\u002Fprotocol\u002Fportal-v2","protocol\u002Fportal-v2",{"title":224,"path":225,"stem":226},"Rate Models & Yield","\u002Fprotocol\u002Frate-models","protocol\u002Frate-models",{"title":228,"path":229,"stem":230},"Roles","\u002Fprotocol\u002Froles","protocol\u002Froles",{"title":232,"path":233,"stem":234},"M0 On Solana","\u002Fprotocol\u002Fsolana","protocol\u002Fsolana",{"title":236,"path":237,"stem":238},"Wrapped M (wM)","\u002Fprotocol\u002Fwrapped-m","protocol\u002Fwrapped-m",{"title":240,"path":241,"stem":242},"Wrapped M Specification","\u002Fprotocol\u002Fwrapped-m-spec","protocol\u002Fwrapped-m-spec",{"title":244,"path":245,"stem":246,"children":247,"page":21},"Resources","\u002Fresources","resources",[248,252,256],{"title":249,"path":250,"stem":251},"Deployments","\u002Fresources\u002Faddresses","resources\u002Faddresses",{"title":253,"path":254,"stem":255},"Audits","\u002Fresources\u002Faudits","resources\u002Faudits",{"title":257,"path":258,"stem":259},"Glossary","\u002Fresources\u002Fglossary","resources\u002Fglossary",{"id":261,"title":196,"body":262,"description":1119,"extension":1120,"links":1121,"meta":1122,"navigation":1123,"path":197,"seo":1124,"stem":198,"__hash__":1125},"docs\u002Fprotocol\u002Fextensions.md",{"type":263,"value":264,"toc":1099},"minimark",[265,270,279,282,287,298,304,320,324,329,355,359,385,389,409,413,417,420,426,430,433,438,442,445,450,454,459,485,494,502,506,530,534,537,564,569,586,590,597,623,627,630,633,637,657,661,665,679,684,715,722,738,743,764,768,772,789,804,808,824,828,832,838,883,887,890,906,913,917,920,944,948,952,955,970,974,980,1000,1004,1008,1023,1026,1030,1033,1047,1051,1071,1075,1078,1092,1095],[266,267,269],"h2",{"id":268},"what-are-m0-extensions","What Are M0 Extensions?",[271,272,273,274,278],"p",{},"M0 Extensions are the ",[275,276,277],"strong",{},"application layer"," of the M0 Protocol. They are custom ERC-20 stablecoins that developers build on the M0 platform, inheriting its security and yield properties while adding their own unique features, branding, and business logic.",[271,280,281],{},"Think of M0 as the secure, collateralized foundation -- like digital infrastructure. Extensions are the applications, products, and user experiences built on top of this foundation.",[283,284,286],"h3",{"id":285},"the-extension-architecture","The Extension Architecture",[288,289,294],"pre",{"className":290,"code":292,"language":293},[291],"language-text","Your Custom Stablecoin (Extension)\n        | wraps\u002Funwraps\n    M0 (Foundation)\n        | backed by\n    US Treasury Collateral\n","text",[295,296,292],"code",{"__ignoreMap":297},"",[271,299,300,303],{},[275,301,302],{},"Key Relationship:"," Extensions are backed 1:1 by eligible collateral, meaning:",[305,306,307,311,314,317],"ul",{},[308,309,310],"li",{},"1 Extension Token = 1 unit of value (always redeemable)",[308,312,313],{},"Extensions inherit the M0 platform's stability and regulatory clarity",[308,315,316],{},"Extension contracts can earn yield (if approved by governance)",[308,318,319],{},"Developers control how that yield flows to users, treasuries, or other destinations",[283,321,323],{"id":322},"why-build-an-extension","Why Build an Extension?",[325,326,328],"h4",{"id":327},"full-customization","Full Customization",[305,330,331,337,343,349],{},[308,332,333,336],{},[275,334,335],{},"Yield Distribution",": Route yield to users, treasury, or split however you want",[308,338,339,342],{},[275,340,341],{},"Access Controls",": Implement KYC, geographic restrictions, or institutional-only access",[308,344,345,348],{},[275,346,347],{},"Fee Mechanisms",": Add transaction fees, management fees, or revenue sharing",[308,350,351,354],{},[275,352,353],{},"Branding",": Create a fully branded stablecoin (YourAppUSD) or keep it generic",[325,356,358],{"id":357},"inherited-benefits","Inherited Benefits",[305,360,361,367,373,379],{},[308,362,363,366],{},[275,364,365],{},"Regulatory Clarity",": Built on M0's compliant, audited infrastructure",[308,368,369,372],{},[275,370,371],{},"Shared Liquidity",": Tap into the M0 ecosystem's shared liquidity layer",[308,374,375,378],{},[275,376,377],{},"Cross-Chain Ready",": Deploy on any chain where M0 operates",[308,380,381,384],{},[275,382,383],{},"Battle-Tested Security",": Leverage M0's proven collateral and governance systems",[325,386,388],{"id":387},"business-value","Business Value",[305,390,391,397,403],{},[308,392,393,396],{},[275,394,395],{},"Control",": Unlike integrating someone else's stablecoin, you own the user relationship",[308,398,399,402],{},[275,400,401],{},"Revenue",": Capture value through yield management and optional fees",[308,404,405,408],{},[275,406,407],{},"Flexibility",": Evolve your stablecoin's features as your needs change",[283,410,412],{"id":411},"common-extension-types","Common Extension Types",[325,414,416],{"id":415},"treasury-extensions","Treasury Extensions",[271,418,419],{},"Route 100% of yield to a single treasury address while providing users with a stable, non-rebasing token experience.",[271,421,422,425],{},[275,423,424],{},"Use Cases",": Protocol treasuries, ecosystem development funds, corporate reserves",[325,427,429],{"id":428},"user-yield-extensions","User Yield Extensions",[271,431,432],{},"Share yield with token holders while taking a small protocol fee for sustainability.",[271,434,435,437],{},[275,436,424],{},": DeFi protocols, consumer apps, yield savings accounts",[325,439,441],{"id":440},"institutional-extensions","Institutional Extensions",[271,443,444],{},"Provide granular, per-account control with custom fee arrangements and whitelisting.",[271,446,447,449],{},[275,448,424],{},": Prime brokerages, fintech platforms, institutional treasury management",[283,451,453],{"id":452},"who-should-build-extensions","Who Should Build Extensions?",[271,455,456],{},[275,457,458],{},"Recommended for:",[305,460,461,467,473,479],{},[308,462,463,466],{},[275,464,465],{},"Application Developers",": Games, payments, DeFi protocols wanting branded stablecoins",[308,468,469,472],{},[275,470,471],{},"Ecosystem Builders",": L1\u002FL2 chains needing native stablecoins for their ecosystems",[308,474,475,478],{},[275,476,477],{},"Fintech Companies",": Businesses requiring custom compliance or yield distribution",[308,480,481,484],{},[275,482,483],{},"Treasury Managers",": Organizations needing yield-bearing accounts with specific controls",[271,486,487],{},[275,488,489,490,493],{},"Consider Wrapped ",[295,491,492],{},"$M"," instead if:",[305,495,496,499],{},[308,497,498],{},"You just need standard DeFi integration (AMM pools, lending markets)",[308,500,501],{},"You prefer using an existing, established token rather than deploying your own",[283,503,505],{"id":504},"real-world-examples","Real-World Examples",[305,507,508,519],{},[308,509,510,518],{},[511,512,513],"a",{"href":237},[275,514,515,516],{},"Wrapped ",[295,517,492],{},": The \"reference implementation\" showing standard DeFi compatibility",[308,520,521,529],{},[511,522,526],{"href":523,"rel":524},"https:\u002F\u002Fdollar.noble.xyz\u002F",[525],"nofollow",[275,527,528],{},"Noble USD",": Cross-chain stablecoin serving the Cosmos ecosystem",[283,531,533],{"id":532},"technical-overview","Technical Overview",[271,535,536],{},"Extensions are smart contracts that:",[538,539,540,546,552,558],"ol",{},[308,541,542,545],{},[275,543,544],{},"Inherit from MExtension.sol",": A base contract providing core wrap\u002Funwrap functionality",[308,547,548,551],{},[275,549,550],{},"Implement Custom Logic",": Add your unique features, access controls, and yield distribution",[308,553,554,557],{},[275,555,556],{},"Gain Earner Approval",": Get governance approval to earn yield",[308,559,560,563],{},[275,561,562],{},"Deploy Anywhere",": Launch on Ethereum, L2s, or any supported chain",[271,565,566],{},[275,567,568],{},"Key Functions Every Extension Must Implement:",[305,570,571,577,583],{},[308,572,573,576],{},[295,574,575],{},"wrap(recipient, amount)",": Convert to your extension token",[308,578,579,582],{},[295,580,581],{},"unwrap(recipient, amount)",": Convert your extension token back",[308,584,585],{},"Custom yield claiming\u002Fdistribution logic (your choice how this works)",[283,587,589],{"id":588},"getting-started","Getting Started",[271,591,592,593,596],{},"Ready to build your own stablecoin? The ",[511,594,595],{"href":124},"Build section"," provides everything you need:",[305,598,599,605,611,617],{},[308,600,601,604],{},[275,602,603],{},"Model Selection Guide",": Choose the right template for your use case",[308,606,607,610],{},[275,608,609],{},"Step-by-Step Deployment",": Deploy and configure your extension",[308,612,613,616],{},[275,614,615],{},"Earner Approval Process",": Get governance approval for yield earning",[308,618,619,622],{},[275,620,621],{},"Integration Examples",": Real code examples and best practices",[266,624,626],{"id":625},"swapfacility-deep-dive","SwapFacility Deep Dive",[283,628,162],{"id":629},"architecture-overview",[271,631,632],{},"SwapFacility serves as the universal router for the M0 Extension ecosystem, enabling atomic conversions between any\napproved M0 Extensions. The contract maintains minimal state while relying on the TTG governance system for extension\napproval and access control.",[325,634,636],{"id":635},"core-dependencies","Core Dependencies",[305,638,639,645,651],{},[308,640,641,644],{},[275,642,643],{},"M Token Base",": The foundational rebasing token that backs all extensions",[308,646,647,650],{},[275,648,649],{},"TTG Registrar",": Governance-controlled registry that maintains the approved earners list",[308,652,653,656],{},[275,654,655],{},"ReentrancyLock",": Advanced protection using transient storage for atomic operations",[283,658,660],{"id":659},"swap-operations","Swap Operations",[325,662,664],{"id":663},"extension-to-extension-swaps","Extension-to-Extension Swaps",[288,666,670],{"className":667,"code":668,"language":669,"meta":297,"style":297},"language-solidity shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","function swap(address extensionIn, address extensionOut, uint256 amount, address recipient) external\n","solidity",[295,671,672],{"__ignoreMap":297},[673,674,677],"span",{"class":675,"line":676},"line",1,[673,678,668],{},[271,680,681],{},[275,682,683],{},"Process Flow:",[538,685,686,692,695,702,708],{},[308,687,688,689],{},"Validates both extensions are approved earners via ",[295,690,691],{},"_revertIfNotApprovedExtension()",[308,693,694],{},"Transfers extension tokens from user to SwapFacility",[308,696,697,698,701],{},"Calls ",[295,699,700],{},"extensionIn.unwrap()"," to convert to $M",[308,703,704,705,707],{},"Measures actual ",[295,706,492],{}," received (accounts for rounding differences in v1 extensions)",[308,709,710,711,714],{},"Approves and calls ",[295,712,713],{},"extensionOut.wrap()"," to mint target extension tokens",[325,716,718,719,721],{"id":717},"direct-m-token-operations","Direct ",[295,720,492],{}," Token Operations",[288,723,725],{"className":667,"code":724,"language":669,"meta":297,"style":297},"function swapInM(address extensionOut, uint256 amount, address recipient) external\nfunction swapOutM(address extensionIn, uint256 amount, address recipient) external\n",[295,726,727,732],{"__ignoreMap":297},[673,728,729],{"class":675,"line":676},[673,730,731],{},"function swapInM(address extensionOut, uint256 amount, address recipient) external\n",[673,733,735],{"class":675,"line":734},2,[673,736,737],{},"function swapOutM(address extensionIn, uint256 amount, address recipient) external\n",[271,739,740],{},[275,741,742],{},"Access Control Differences:",[305,744,745,754],{},[308,746,747,750,751,753],{},[295,748,749],{},"swapInM",": Anyone can convert ",[295,752,492],{}," to extensions",[308,755,756,759,760,763],{},[295,757,758],{},"swapOutM",": Requires ",[295,761,762],{},"M_SWAPPER_ROLE"," or permission for specific extension",[283,765,767],{"id":766},"permission-system","Permission System",[325,769,771],{"id":770},"two-tier-extension-model","Two-Tier Extension Model",[538,773,774,780],{},[308,775,776,779],{},[275,777,778],{},"Standard Extensions",": Open for general extension-to-extension swaps",[308,781,782,785,786,788],{},[275,783,784],{},"Permissioned Extensions",": Require special authorization for ",[295,787,492],{}," conversions",[288,790,792],{"className":667,"code":791,"language":669,"meta":297,"style":297},"function setPermissionedExtension(address extension, bool permissioned) external\nfunction setPermissionedMSwapper(address extension, address swapper, bool allowed) external\n",[295,793,794,799],{"__ignoreMap":297},[673,795,796],{"class":675,"line":676},[673,797,798],{},"function setPermissionedExtension(address extension, bool permissioned) external\n",[673,800,801],{"class":675,"line":734},[673,802,803],{},"function setPermissionedMSwapper(address extension, address swapper, bool allowed) external\n",[325,805,807],{"id":806},"role-based-access","Role-Based Access",[305,809,810,816],{},[308,811,812,815],{},[295,813,814],{},"DEFAULT_ADMIN_ROLE",": Contract administration and upgrades",[308,817,818,820,821,823],{},[295,819,762],{},": Global permission for ",[295,822,758],{}," operations on standard extensions",[283,825,827],{"id":826},"security-features","Security Features",[325,829,831],{"id":830},"advanced-reentrancy-protection","Advanced Reentrancy Protection",[271,833,834,835,837],{},"The contract inherits from ",[295,836,655],{}," which implements transient storage-based locking:",[288,839,841],{"className":667,"code":840,"language":669,"meta":297,"style":297},"modifier isNotLocked() {\n    if (Locker.get() != address(0)) revert ContractLocked();\n    address caller_ = isTrustedRouter(msg.sender) ? IMsgSender(msg.sender).msgSender() : msg.sender;\n    Locker.set(caller_);\n    _;\n    Locker.set(address(0));\n}\n",[295,842,843,848,853,859,865,871,877],{"__ignoreMap":297},[673,844,845],{"class":675,"line":676},[673,846,847],{},"modifier isNotLocked() {\n",[673,849,850],{"class":675,"line":734},[673,851,852],{},"    if (Locker.get() != address(0)) revert ContractLocked();\n",[673,854,856],{"class":675,"line":855},3,[673,857,858],{},"    address caller_ = isTrustedRouter(msg.sender) ? IMsgSender(msg.sender).msgSender() : msg.sender;\n",[673,860,862],{"class":675,"line":861},4,[673,863,864],{},"    Locker.set(caller_);\n",[673,866,868],{"class":675,"line":867},5,[673,869,870],{},"    _;\n",[673,872,874],{"class":675,"line":873},6,[673,875,876],{},"    Locker.set(address(0));\n",[673,878,880],{"class":675,"line":879},7,[673,881,882],{},"}\n",[325,884,886],{"id":885},"trusted-router-system","Trusted Router System",[271,888,889],{},"For complex integrations (like UniswapV3SwapAdapter), trusted routers can specify the original caller:",[305,891,892,899],{},[308,893,894,895,898],{},"Direct calls: ",[295,896,897],{},"msg.sender"," is stored as the locker",[308,900,901,902,905],{},"Trusted router calls: ",[295,903,904],{},"IMsgSender(msg.sender).msgSender()"," retrieves the original user",[271,907,908,909,912],{},"Extensions can call ",[295,910,911],{},"swapFacility.msgSender()"," to get the true transaction initiator.",[325,914,916],{"id":915},"governance-integration","Governance Integration",[271,918,919],{},"All extension approvals are checked against the TTG Registrar:",[288,921,923],{"className":667,"code":922,"language":669,"meta":297,"style":297},"function _isApprovedEarner(address extension) private view returns (bool) {\n    return IRegistrarLike(registrar).get(EARNERS_LIST_IGNORED_KEY) != bytes32(0) ||\n           IRegistrarLike(registrar).listContains(EARNERS_LIST_NAME, extension);\n}\n",[295,924,925,930,935,940],{"__ignoreMap":297},[673,926,927],{"class":675,"line":676},[673,928,929],{},"function _isApprovedEarner(address extension) private view returns (bool) {\n",[673,931,932],{"class":675,"line":734},[673,933,934],{},"    return IRegistrarLike(registrar).get(EARNERS_LIST_IGNORED_KEY) != bytes32(0) ||\n",[673,936,937],{"class":675,"line":855},[673,938,939],{},"           IRegistrarLike(registrar).listContains(EARNERS_LIST_NAME, extension);\n",[673,941,942],{"class":675,"line":861},[673,943,882],{},[283,945,947],{"id":946},"gas-optimization","Gas Optimization",[325,949,951],{"id":950},"permit-integration","Permit Integration",[271,953,954],{},"All swap functions include permit variants supporting both EIP-2612 and EIP-712 signatures:",[288,956,958],{"className":667,"code":957,"language":669,"meta":297,"style":297},"function swapWithPermit(..., uint256 deadline, uint8 v, bytes32 r, bytes32 s) external\nfunction swapWithPermit(..., uint256 deadline, bytes calldata signature) external\n",[295,959,960,965],{"__ignoreMap":297},[673,961,962],{"class":675,"line":676},[673,963,964],{},"function swapWithPermit(..., uint256 deadline, uint8 v, bytes32 r, bytes32 s) external\n",[673,966,967],{"class":675,"line":734},[673,968,969],{},"function swapWithPermit(..., uint256 deadline, bytes calldata signature) external\n",[325,971,973],{"id":972},"balance-tracking-precision","Balance Tracking Precision",[271,975,976,977,979],{},"For compatibility with Wrapped ",[295,978,492],{}," v1, the contract measures actual balance changes:",[288,981,983],{"className":667,"code":982,"language":669,"meta":297,"style":297},"uint256 mBalanceBefore = _mBalanceOf(address(this));\nIMExtension(extensionIn).unwrap(address(this), amount);\namount = _mBalanceOf(address(this)) - mBalanceBefore;\n",[295,984,985,990,995],{"__ignoreMap":297},[673,986,987],{"class":675,"line":676},[673,988,989],{},"uint256 mBalanceBefore = _mBalanceOf(address(this));\n",[673,991,992],{"class":675,"line":734},[673,993,994],{},"IMExtension(extensionIn).unwrap(address(this), amount);\n",[673,996,997],{"class":675,"line":855},[673,998,999],{},"amount = _mBalanceOf(address(this)) - mBalanceBefore;\n",[283,1001,1003],{"id":1002},"technical-implementation","Technical Implementation",[325,1005,1007],{"id":1006},"immutable-architecture","Immutable Architecture",[288,1009,1011],{"className":667,"code":1010,"language":669,"meta":297,"style":297},"address public immutable mToken;\naddress public immutable registrar;\n",[295,1012,1013,1018],{"__ignoreMap":297},[673,1014,1015],{"class":675,"line":676},[673,1016,1017],{},"address public immutable mToken;\n",[673,1019,1020],{"class":675,"line":734},[673,1021,1022],{},"address public immutable registrar;\n",[271,1024,1025],{},"Core dependencies are immutable for security, while operational parameters remain upgradeable.",[325,1027,1029],{"id":1028},"state-management","State Management",[271,1031,1032],{},"The contract maintains minimal state:",[305,1034,1035,1041],{},[308,1036,1037,1040],{},[295,1038,1039],{},"permissionedExtensions",": Extensions requiring special authorization",[308,1042,1043,1046],{},[295,1044,1045],{},"permissionedMSwappers",": Authorized swappers for specific permissioned extensions",[325,1048,1050],{"id":1049},"event-system","Event System",[288,1052,1054],{"className":667,"code":1053,"language":669,"meta":297,"style":297},"event Swapped(address indexed extensionIn, address indexed extensionOut, uint256 amount, address indexed recipient);\nevent SwappedInM(address indexed extensionOut, uint256 amount, address indexed recipient);\nevent SwappedOutM(address indexed extensionIn, uint256 amount, address indexed recipient);\n",[295,1055,1056,1061,1066],{"__ignoreMap":297},[673,1057,1058],{"class":675,"line":676},[673,1059,1060],{},"event Swapped(address indexed extensionIn, address indexed extensionOut, uint256 amount, address indexed recipient);\n",[673,1062,1063],{"class":675,"line":734},[673,1064,1065],{},"event SwappedInM(address indexed extensionOut, uint256 amount, address indexed recipient);\n",[673,1067,1068],{"class":675,"line":855},[673,1069,1070],{},"event SwappedOutM(address indexed extensionIn, uint256 amount, address indexed recipient);\n",[283,1072,1074],{"id":1073},"economic-guarantees","Economic Guarantees",[271,1076,1077],{},"SwapFacility maintains perfect 1:1 value relationships by design:",[305,1079,1080,1083,1086,1089],{},[308,1081,1082],{},"No slippage or trading fees",[308,1084,1085],{},"Atomic execution prevents arbitrage",[308,1087,1088],{},"All conversions preserve dollar parity",[308,1090,1091],{},"Extensions remain fully backed by eligible collateral",[271,1093,1094],{},"The contract creates implicit liquidity between all M0 Extensions without requiring separate AMM pools, enabling\nseamless cross-extension value transfer.",[1096,1097,1098],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":297,"searchDepth":676,"depth":734,"links":1100},[1101,1110],{"id":268,"depth":734,"text":269,"children":1102},[1103,1104,1105,1106,1107,1108,1109],{"id":285,"depth":855,"text":286},{"id":322,"depth":855,"text":323},{"id":411,"depth":855,"text":412},{"id":452,"depth":855,"text":453},{"id":504,"depth":855,"text":505},{"id":532,"depth":855,"text":533},{"id":588,"depth":855,"text":589},{"id":625,"depth":734,"text":626,"children":1111},[1112,1113,1114,1115,1116,1117,1118],{"id":629,"depth":855,"text":162},{"id":659,"depth":855,"text":660},{"id":766,"depth":855,"text":767},{"id":826,"depth":855,"text":827},{"id":946,"depth":855,"text":947},{"id":1002,"depth":855,"text":1003},{"id":1073,"depth":855,"text":1074},"Documentation of M0 Extensions, the application layer for building custom stablecoins on the M0 platform, including the SwapFacility for seamless 1:1 conversions.","md",null,{},true,{"title":196,"description":1119},"-1eIPAITiBzoD-b2dtIIIR29AZNGdCNhouGsJiKMCoQ",[1127,1129],{"title":192,"path":193,"stem":194,"description":1128,"children":-1},"Documentation of the Distribution Vault (TTGVault), the core component for collecting and distributing protocol revenue to Zero token holders.",{"title":200,"path":201,"stem":202,"description":1130,"children":-1},"Technical deep dive into M0's onchain settlement layer for trustless, intent-based token exchanges across chains with partial fills, gasless orders, and secure cancellation."]