PageSourceSearch

https://docs-9s1.pages.dev/assets/js/e2f60882.5b7a28f3.js

js docs-9s1.pages.dev collected 2026-10-03 05:10:44 UTC 8,780 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocs_dao=self.webpackChunkdocs_dao||[]).push([[3924],{72:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var n=o(1527),s=o(8627),i=o(9560);const r={},a="User Points Proxy",c={id:"Antelope smart-contracts/alien worlds-smart-contracts/userpoints-proxy",title:"User Points Proxy",description:"Within the suite of Alien Worlds Smart contracts, one of them is responsible for the rewarding of alien.worlds NFTs as determined by non-transferrable user points. The user points are intended to be distributed to users for performing various game-related activities in the Alien Worlds metaverse. But this is also an avenue for malicious actors to be able to potentially get free NFTs if this mechanism is not well protected from bad actors.",source:"@site/docs/02- Antelope smart-contracts/02- alien worlds-smart-contracts/05- userpoints-proxy.md",sourceDirName:"02- Antelope smart-contracts/02- alien worlds-smart-contracts",slug:"/Antelope smart-contracts/alien worlds-smart-contracts/userpoints-proxy",permalink:"/Antelope smart-contracts/alien worlds-smart-contracts/userpoints-proxy",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:5,frontMatter:{},sidebar:"defaultSidebar",previous:{title:"User Points",permalink:"/Antelope smart-contracts/alien worlds-smart-contracts/user-points"},next:{title:"Land Ratings",permalink:"/Antelope smart-contracts/alien worlds-smart-contracts/landratings"}},l={},d=[{value:"Contract details:",id:"contract-details",level:2},{value:"Contracts",id:"contracts",level:2}];function u(t){const e={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,s.a)(),...t.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e.h1,{id:"user-points-proxy",children:"User Points Proxy"}),"\n",(0,n.jsx)(e.p,{children:"Within the suite of Alien Worlds Smart contracts, one of them is responsible for the rewarding of alien.worlds NFTs as determined by non-transferrable user points. The user points are intended to be distributed to users for performing various game-related activities in the Alien Worlds metaverse. But this is also an avenue for malicious actors to be able to potentially get free NFTs if this mechanism is not well protected from bad actors.\nUp until now, the only use case to be rewarded user points has been mining activity with the plan to gradually add other Alien Worlds activities but still within the safe boundaries of the Alien Worlds suite of smart contracts. With the Points Proxy Smart Contract, we are introducing an open way for 3rd parties to be able to add user points in a safe and regulated way. This would be regulated in the form of trusted accounts being granted the ability to distribute a given budget of points to any chosen user's accounts over a chosen time period. Once that budget has been exceeded for the given time period that trusted account will not be able to add any more points until that time window has expired. Each trusted account could have its configuration set such that the points can be scaled with a multiplier factor and could be set to send the points directly into the core user points contract or to send them in batches to provide another layer of control for the trusted account before passing the points directly to AlienWorlds User points."}),"\n",(0,n.jsxs)(e.p,{children:["An example could be: a trusted account ",(0,n.jsx)(e.code,{children:"gamebuilder1"})," is granted permission to distribute 100,000 points every 30 days.\nThrough their game called \u201cPointyBlocks\u201d users earn in-game points in PointyBlocks which they want to be able to share with AlienWorlds  users as User points. Via their trusted mechanism they can prepare and send an action called ",(0,n.jsx)(e.code,{children:"addpoints"})," to ",(0,n.jsx)(e.code,{children:"ptpxy.worlds"})," on WAX blockchain. This action will need to be signed by the trusted account ",(0,n.jsx)(e.code,{children:"gamebuilder1"})," and would specify the WAX account to receive the points and the number of points the account should receive.\nEach trusted account could be configured to either send points on synchronously to the core user points contract or to send points in batches via a ",(0,n.jsx)(e.code,{children:"processbatch"})," action that would be called periodically by the trusted account ",(0,n.jsx)(e.code,{children:"gamebuider1"}),". If the batch option is set then the added points will get accumulated in a points table within the Points Proxy contract scoped to the trusted account. In this case, the budget and multiplier will only be enforced at the point of trying to run ",(0,n.jsx)(e.code,{children:"processbatch"}),".\nEach trusted account can be configured to run in debug mode which will allow them to test the workflow with test accounts that will send ",(0,n.jsx)(e.code,{children:"testaddpnts"})," actions to the core userpoints contract to help with testing and debugging.\nAll the configurations will only be managed by Alien Worlds to grant the budget and switch between debug and active modes"]}),"\n",(0,n.jsx)(e.h2,{id:"contract-details",children:"Contract details:"}),"\n","\n","\n",(0,n.jsxs)(e.p,{children:["UserPoints ",(0,n.jsx)(i.km,{contract:"uspts.worlds"})]}),"\n",(0,n.jsxs)(e.p,{children:["User Points Proxy ",(0,n.jsx)(i.km,{contract:"ptpxy.worlds"})]}),"\n",(0,n.jsx)(e.pre,{children:(0,n.jsx)(e.code,{className:"language-ts",children:"// Point Proxy config/state details for each trusted account:\nstruct config {\n    bool           active        = false; // If true addpoints will work\n    bool           debug_mode    = false; // if true send testaddpnts\n    float          multiplier    = 1; // multiplier to apply to points -> uspts.worlds\n    bool           batchProcess  = true; // Send points in batches with processbatch\n    uint64_t       running_total = 0; // global total of points for trusted account\n    uint64_t       period_total  = 0; // running total for the current period\n    uint64_t       period_budget = 0; // limit of allowable points per period\n    time_point_sec period_end;
1 // timestamp when to reset the period time.\n    uint32_t       period_duration = 30 * 24 * 60 * 60; // duration of period.\n}\n"})}),"\n",(0,n.jsx)(e.h2,{id:"contracts",children:"Contracts"}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.img,{src:"https://lucid.app/publicSegments/view/a27a2c28-27b2-44bf-bea0-12b695123739/image.png",alt:""})}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.a,{href:"https://lucid.app/lucidchart/68bd385a-f393-4e9b-bff0-c7d6ed69fad7/edit?page=0&v=772&s=612",children:"Edit Diagram"})})]})}function h(t={}){const{wrapper:e}={...(0,s.a)(),...t.components};return e?(0,n.jsx)(e,{...t,children:(0,n.jsx)(u,{...t})}):u(t)}},9560:(t,e,o)=>{o.d(e,{DO:()=>c,g8:()=>a,km:()=>r});var n=o(5546),s=o(1527);function i(t){let{url:e,dark_image:o,light_image:i}=t;return(0,s.jsx)("a",{href:e,target:"_blank",style:{margin:"5px"},children:(0,s.jsx)(n.Z,{sources:{dark:o,light:i},width:"25px",height:"25px",style:{marginBottom:"-5px"}})})}function r(t){let{contract:e}=t;return(0,s.jsxs)("span",{children:[(0,s.jsx)("code",{children:`${e}`}),(0,s.jsx)(i,{url:`https://wax.bloks.io/account/${e}`,light_image:"/img/bloks_logomark_dark.png",dark_image:"/img/bloks_logomark_white.png"}),(0,s.jsx)(i,{url:`https://waxblock.io/account/${e}`,light_image:"/img/waxblocks-logo.png",dark_image:"/img/waxblocks-logo.png"})]})}function a(t){let{contract:e,action:o}=t;return(0,s.jsxs)("span",{children:[(0,s.jsx)("code",{children:`${e}::${o}`}),(0,s.jsx)(i,{url:`https://wax.bloks.io/account/${e}?loadContract=true&tab=Actions&action=${o}`,light_image:"/img/bloks_logomark_dark.png",dark_image:"/img/bloks_logomark_white.png"}),(0,s.jsx)(i,{url:`https://waxblock.io/account/${e}?action=${o}#contract-actions`,light_image:"/img/waxblocks-logo.png",dark_image:"/img/waxblocks-logo.png"})]})}function c(t){let{contract:e,table:o}=t;return(0,s.jsxs)("span",{children:[(0,s.jsx)("code",{children:`${e}::${o}`}),(0,s.jsx)(i,{url:`https://wax.bloks.io/account/${e}?loadContract=true&tab=Tables&table=${o}&limit=100`,light_image:"/img/bloks_logomark_dark.png",dark_image:"/img/bloks_logomark_white.png"}),(0,s.jsx)(i,{url:`https://waxblock.io/account/${e}?&table=${o}#contract-tables`,light_image:"/img/waxblocks-logo.png",dark_image:"/img/waxblocks-logo.png"})]})}},8627:(t,e,o)=>{o.d(e,{Z:()=>a,a:()=>r});var n=o(959);const s={},i=n.createContext(s);function r(t){const e=n.useContext(i);return n.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function a(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(s):t.components||s:r(t.components),n.createElement(i.Provider,{value:e},t.children)}}}]);

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.