1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8860],{1957:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/examples/buildingupgradebounty",function(){return t(5949)}])},5949:function(e,n,t){"use strict";t.r(n),t.d(n,{__toc:function(){return o},default:function(){return d}});var i=t(5893),a=t(2673),s=t(2643),r={src:"/_next/static/media/delegate-alice.7fa2e4ea.svg",height:1880,width:3072,blurWidth:0,blurHeight:0},l={src:"/_next/static/media/delegate-bob.e9ac00df.svg",height:1880,width:3072,blurWidth:0,blurHeight:0};let o=[{depth:2,value:"About",id:"about"},{depth:2,value:"Diagrams",id:"diagrams"}];function _createMdxContent(e){let n=Object.assign({h1:"h1",p:"p",a:"a",h2:"h2",strong:"strong",code:"code",ul:"ul",li:"li",img:"img"},(0,s.a)(),e.components);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{children:"Building Upgrade Bounty"}),"\n",(0,i.jsxs)(n.p,{children:["Source code for the following example is available\n",(0,i.jsx)(n.a,{href:"https://github.com/primodiumxyz/developer/tree/main/examples/",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"about",children:"About"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"BuildingUpgradeBounty"})})," is a world extension that enables the deployer to\nissue a private bounty for an outside party to upgrade the deployer's building\non their behalf, in exchange for a reward."]}),"\n",(0,i.jsx)(n.p,{children:"Building upgrades cost resources, and it takes time to accumulate the necessary\nresources. There are some advantages of accelerating resource accumulation when\nyou upgrade a building as soon as possible."}),"\n",(0,i.jsx)(n.p,{children:"Let's look at two players, Alice and Bob. If Alice is going to be AFK and\ndoesn't want to manage running a bot, she can create a building upgrade bounty\nand delegate the upgrade to another player, Bob, in exchange for a small reward."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Alice deploys and registers namespace and private systems for extending game\nlogic"}),"\n",(0,i.jsxs)(n.li,{children:["Alice delegates ",(0,i.jsx)(n.code,{children:"UpgradeBuildingSystem"})," control to the private system"]}),"\n",(0,i.jsx)(n.li,{children:"Alice registers namespace access to Bob, Charlie, etc. to enable their\nparticipation in the bounty"}),"\n",(0,i.jsx)(n.li,{children:"Alice deposits escrow (ETH) for the bounty in the private system"}),"\n",(0,i.jsx)(n.li,{children:"Bob calls the private system to upgrade Alice's building"}),"\n",(0,i.jsx)(n.li,{children:"Bob receives the bounty reward from the private system"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"diagrams",children:"Diagrams"}),"\n",(0,i.jsxs)(n.p,{children:["For the above example, the delegation flow begins with Alice delegating the\n",(0,i.jsx)(n.code,{children:"UpgradeBuildingSystem"})," control to the private system and then registering\nnamespace access to Bob."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Alice delegates",src:r})}),"\n",(0,i.jsx)(n.p,{children:"Then, Bob calls the private system to upgrade Alice's building through the\nexternal system in the external namespace."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Bob calls",src:l})})]})}var d=(0,a.j)({MDXContent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:n}=Object.assign({},(0,s.a)(),e.components);return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(_createMdxContent,{...e})}):_createMdxContent(e)},pageOpts:{filePath:"pages/examples/buildingupgradebounty.mdx",route:"/examples/buildingupgradebounty",title:"Building Upgrade Bounty",headings:o},pageNextRoute:"/examples/buildingupgradebounty"})}},function(e){e.O(0,[2673,9774,2888,179],function(){return e(e.s=1957)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.