diff --git a/404.html b/404.html index 55c6491af..21297268e 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ Page Not Found | Starknet Devnet - + diff --git a/assets/js/2d66ba60.5554bca5.js b/assets/js/2d66ba60.5554bca5.js new file mode 100644 index 000000000..c147f8dde --- /dev/null +++ b/assets/js/2d66ba60.5554bca5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[952],{3946:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var o=t(4848),r=t(8453);const i={},a="Forking",c={id:"forking",title:"Forking",description:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.",source:"@site/docs/forking.md",sourceDirName:".",slug:"/forking",permalink:"/starknet-devnet-rs/docs/next/forking",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/forking.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/next/dump-load-restart"},next:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/next/historic-state"}},s={},d=[{value:"Account impersonation",id:"account-impersonation",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"forking",children:"Forking"}),"\n",(0,o.jsx)(n.p,{children:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"$ starknet-devnet --fork-network [--fork-block ]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The value passed to ",(0,o.jsx)(n.code,{children:"--fork-network"})," should be the URL to a Starknet JSON-RPC API provider. Specifying a ",(0,o.jsx)(n.code,{children:"--fork-block"})," is optional; it defaults to the ",(0,o.jsx)(n.code,{children:'"latest"'})," block at the time of Devnet's start-up. All calls will first try Devnet's state and then fall back to the forking block."]}),"\n",(0,o.jsx)(n.h2,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./account-impersonation",children:"Here"})," you can read more about acting as an account deployed on the origin."]}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./predeployed#deploying-an-undeclared-account",children:"Here"})," you can read about deploying an account not declared on Devnet."]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var o=t(6540);const r={},i=o.createContext(r);function a(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2d66ba60.709cdb58.js b/assets/js/2d66ba60.709cdb58.js deleted file mode 100644 index 020487d82..000000000 --- a/assets/js/2d66ba60.709cdb58.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[952],{3946:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>u,frontMatter:()=>i,metadata:()=>a,toc:()=>d});var o=n(4848),r=n(8453);const i={},s="Forking",a={id:"forking",title:"Forking",description:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.",source:"@site/docs/forking.md",sourceDirName:".",slug:"/forking",permalink:"/starknet-devnet-rs/docs/next/forking",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/forking.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/next/dump-load-restart"},next:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/next/historic-state"}},c={},d=[{value:"Account impersonation",id:"account-impersonation",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"forking",children:"Forking"}),"\n",(0,o.jsx)(t.p,{children:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself."}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"$ starknet-devnet --fork-network [--fork-block ]\n"})}),"\n",(0,o.jsxs)(t.p,{children:["The value passed to ",(0,o.jsx)(t.code,{children:"--fork-network"})," should be the URL to a Starknet JSON-RPC API provider. Specifying a ",(0,o.jsx)(t.code,{children:"--fork-block"})," is optional; it defaults to the ",(0,o.jsx)(t.code,{children:'"latest"'})," block at the time of Devnet's start-up. All calls will first try Devnet's state and then fall back to the forking block."]}),"\n",(0,o.jsx)(t.h2,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.a,{href:"./account-impersonation",children:"Here"})," you can read more about acting as an account deployed on the origin."]})]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>a});var o=n(6540);const r={},i=o.createContext(r);function s(e){const t=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),o.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3c883fc4.36877ea9.js b/assets/js/3c883fc4.36877ea9.js new file mode 100644 index 000000000..45fa7e1f9 --- /dev/null +++ b/assets/js/3c883fc4.36877ea9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2871],{8432:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var o=t(4848),r=t(8453);const i={},a="Forking",c={id:"forking",title:"Forking",description:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.",source:"@site/versioned_docs/version-0.0.6/forking.md",sourceDirName:".",slug:"/forking",permalink:"/starknet-devnet-rs/docs/forking",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.6/forking.md",tags:[],version:"0.0.6",frontMatter:{},sidebar:"docSidebar",previous:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/dump-load-restart"},next:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/historic-state"}},s={},d=[{value:"Account impersonation",id:"account-impersonation",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"forking",children:"Forking"}),"\n",(0,o.jsx)(n.p,{children:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"$ starknet-devnet --fork-network [--fork-block ]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The value passed to ",(0,o.jsx)(n.code,{children:"--fork-network"})," should be the URL to a Starknet JSON-RPC API provider. Specifying a ",(0,o.jsx)(n.code,{children:"--fork-block"})," is optional; it defaults to the ",(0,o.jsx)(n.code,{children:'"latest"'})," block at the time of Devnet's start-up. All calls will first try Devnet's state and then fall back to the forking block."]}),"\n",(0,o.jsx)(n.h2,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./account-impersonation",children:"Here"})," you can read more about acting as an account deployed on the origin."]}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./predeployed#deploying-an-undeclared-account",children:"Here"})," you can read about deploying an account not declared on Devnet."]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var o=t(6540);const r={},i=o.createContext(r);function a(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3c883fc4.d516223c.js b/assets/js/3c883fc4.d516223c.js deleted file mode 100644 index bd71ee08e..000000000 --- a/assets/js/3c883fc4.d516223c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2871],{8432:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>u,frontMatter:()=>i,metadata:()=>a,toc:()=>d});var o=n(4848),r=n(8453);const i={},s="Forking",a={id:"forking",title:"Forking",description:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.",source:"@site/versioned_docs/version-0.0.6/forking.md",sourceDirName:".",slug:"/forking",permalink:"/starknet-devnet-rs/docs/forking",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.6/forking.md",tags:[],version:"0.0.6",frontMatter:{},sidebar:"docSidebar",previous:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/dump-load-restart"},next:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/historic-state"}},c={},d=[{value:"Account impersonation",id:"account-impersonation",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"forking",children:"Forking"}),"\n",(0,o.jsx)(t.p,{children:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself."}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"$ starknet-devnet --fork-network [--fork-block ]\n"})}),"\n",(0,o.jsxs)(t.p,{children:["The value passed to ",(0,o.jsx)(t.code,{children:"--fork-network"})," should be the URL to a Starknet JSON-RPC API provider. Specifying a ",(0,o.jsx)(t.code,{children:"--fork-block"})," is optional; it defaults to the ",(0,o.jsx)(t.code,{children:'"latest"'})," block at the time of Devnet's start-up. All calls will first try Devnet's state and then fall back to the forking block."]}),"\n",(0,o.jsx)(t.h2,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.a,{href:"./account-impersonation",children:"Here"})," you can read more about acting as an account deployed on the origin."]})]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>a});var o=n(6540);const r={},i=o.createContext(r);function s(e){const t=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),o.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5fadd32f.526f0254.js b/assets/js/5fadd32f.526f0254.js new file mode 100644 index 000000000..e74d1e744 --- /dev/null +++ b/assets/js/5fadd32f.526f0254.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[562],{6920:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>a,metadata:()=>r,toc:()=>d});var o=t(4848),s=t(8453);const a={},i="Account impersonation",r={id:"account-impersonation",title:"Account impersonation",description:"This page is about account impersonation. To read about account class selection and deployment, click here.",source:"@site/docs/account-impersonation.md",sourceDirName:".",slug:"/account-impersonation",permalink:"/starknet-devnet-rs/docs/next/account-impersonation",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/account-impersonation.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/next/running/cli"},next:{title:"API",permalink:"/starknet-devnet-rs/docs/next/api"}},c={},d=[{value:"API",id:"api",level:2},{value:"devnet_impersonateAccount",id:"devnet_impersonateaccount",level:3},{value:"devnet_stopImpersonateAccount",id:"devnet_stopimpersonateaccount",level:3},{value:"devnet_autoImpersonate",id:"devnet_autoimpersonate",level:3},{value:"devnet_stopAutoImpersonate",id:"devnet_stopautoimpersonate",level:3}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsxs)(n.p,{children:["This page is about account impersonation. To read about account class selection and deployment, click ",(0,o.jsx)(n.a,{href:"./predeployed",children:"here"}),"."]})}),"\n",(0,o.jsxs)(n.p,{children:["Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in ",(0,o.jsx)(n.a,{href:"/starknet-devnet-rs/docs/next/forking",children:"forking mode"}),"."]}),"\n",(0,o.jsx)(n.admonition,{title:"Caveat",type:"warning",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Only ",(0,o.jsx)(n.code,{children:"INVOKE"})," and ",(0,o.jsx)(n.code,{children:"DECLARE"})," transactions are supported. ",(0,o.jsx)(n.code,{children:"DEPLOY_ACCOUNT"})," transaction is not supported, but you can create an ",(0,o.jsx)(n.code,{children:"INVOKE"})," transaction to UDC."]}),"\n",(0,o.jsx)(n.li,{children:"Overall fee, for transactions sent with an impersonated account, will be lower compared to normal transactions. The reason is that validation part is skipped."}),"\n",(0,o.jsxs)(n.li,{children:["The most common way of sending a transaction is via starknet-rs/starknet.js or starkli. Trying to send with an account that ",(0,o.jsx)(n.strong,{children:"does not"})," exist even in the origin network will return an error:","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["In transaction construction, if account nonce is not hardcoded, Devnet is queried and returns ",(0,o.jsx)(n.code,{children:"ContractNotFound"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Otherwise the nonce fetching part is skipped and ",(0,o.jsx)(n.code,{children:"InsufficientAccountBalance"})," is returned."]}),"\n"]}),"\n"]}),"\n"]})}),"\n",(0,o.jsx)(n.h2,{id:"api",children:"API"}),"\n",(0,o.jsx)(n.p,{children:"Account impersonation follows JSON-RPC method specification. Each method returns an empty response:"}),"\n",(0,o.jsx)(n.h3,{id:"devnet_impersonateaccount",children:"devnet_impersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Impersonates a specific account address nonexistent in the local state."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_impersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopimpersonateaccount",children:"devnet_stopImpersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Stops the impersonation of an account previously marked for impersonation."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopImpersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_autoimpersonate",children:"devnet_autoImpersonate"}),"\n",(0,o.jsx)(n.p,{children:"Enables automatic account impersonation. Every account that does not exist in the local state will be impersonated."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_autoImpersonate",\n "params": {}\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopautoimpersonate",children:"devnet_stopAutoImpersonate"}),"\n",(0,o.jsxs)(n.p,{children:["Stops the effect of ",(0,o.jsx)(n.a,{href:"#devnet_autoimpersonate",children:"automatic impersonation"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopAutoImpersonate",\n "params": {}\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>r});var o=t(6540);const s={},a=o.createContext(s);function i(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5fadd32f.f01f946b.js b/assets/js/5fadd32f.f01f946b.js deleted file mode 100644 index 308abe12e..000000000 --- a/assets/js/5fadd32f.f01f946b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[562],{6920:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>a,metadata:()=>r,toc:()=>d});var o=t(4848),s=t(8453);const a={},i="Account impersonation",r={id:"account-impersonation",title:"Account impersonation",description:"Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in forking mode.",source:"@site/docs/account-impersonation.md",sourceDirName:".",slug:"/account-impersonation",permalink:"/starknet-devnet-rs/docs/next/account-impersonation",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/account-impersonation.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/next/running/cli"},next:{title:"API",permalink:"/starknet-devnet-rs/docs/next/api"}},c={},d=[{value:"API",id:"api",level:2},{value:"devnet_impersonateAccount",id:"devnet_impersonateaccount",level:3},{value:"devnet_stopImpersonateAccount",id:"devnet_stopimpersonateaccount",level:3},{value:"devnet_autoImpersonate",id:"devnet_autoimpersonate",level:3},{value:"devnet_stopAutoImpersonate",id:"devnet_stopautoimpersonate",level:3}];function l(n){const e={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...n.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.h1,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsxs)(e.p,{children:["Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in ",(0,o.jsx)(e.a,{href:"/starknet-devnet-rs/docs/next/forking",children:"forking mode"}),"."]}),"\n",(0,o.jsx)(e.admonition,{title:"Caveat",type:"warning",children:(0,o.jsxs)(e.ul,{children:["\n",(0,o.jsxs)(e.li,{children:["Only ",(0,o.jsx)(e.code,{children:"INVOKE"})," and ",(0,o.jsx)(e.code,{children:"DECLARE"})," transactions are supported. ",(0,o.jsx)(e.code,{children:"DEPLOY_ACCOUNT"})," transaction is not supported, but you can create an ",(0,o.jsx)(e.code,{children:"INVOKE"})," transaction to UDC."]}),"\n",(0,o.jsx)(e.li,{children:"Overall fee, for transactions sent with an impersonated account, will be lower compared to normal transactions. The reason is that validation part is skipped."}),"\n",(0,o.jsxs)(e.li,{children:["The most common way of sending a transaction is via starknet-rs/starknet.js or starkli. Trying to send with an account that ",(0,o.jsx)(e.strong,{children:"does not"})," exist even in the origin network will return an error:","\n",(0,o.jsxs)(e.ul,{children:["\n",(0,o.jsxs)(e.li,{children:["In transaction construction, if account nonce is not hardcoded, Devnet is queried and returns ",(0,o.jsx)(e.code,{children:"ContractNotFound"}),"."]}),"\n",(0,o.jsxs)(e.li,{children:["Otherwise the nonce fetching part is skipped and ",(0,o.jsx)(e.code,{children:"InsufficientAccountBalance"})," is returned."]}),"\n"]}),"\n"]}),"\n"]})}),"\n",(0,o.jsx)(e.h2,{id:"api",children:"API"}),"\n",(0,o.jsx)(e.p,{children:"Account impersonation follows JSON-RPC method specification. Each method returns an empty response:"}),"\n",(0,o.jsx)(e.h3,{id:"devnet_impersonateaccount",children:"devnet_impersonateAccount"}),"\n",(0,o.jsx)(e.p,{children:"Impersonates a specific account address nonexistent in the local state."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_impersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_stopimpersonateaccount",children:"devnet_stopImpersonateAccount"}),"\n",(0,o.jsx)(e.p,{children:"Stops the impersonation of an account previously marked for impersonation."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopImpersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_autoimpersonate",children:"devnet_autoImpersonate"}),"\n",(0,o.jsx)(e.p,{children:"Enables automatic account impersonation. Every account that does not exist in the local state will be impersonated."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_autoImpersonate",\n "params": {}\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_stopautoimpersonate",children:"devnet_stopAutoImpersonate"}),"\n",(0,o.jsxs)(e.p,{children:["Stops the effect of ",(0,o.jsx)(e.a,{href:"#devnet_autoimpersonate",children:"automatic impersonation"}),"."]}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopAutoImpersonate",\n "params": {}\n}\n'})})]})}function p(n={}){const{wrapper:e}={...(0,s.R)(),...n.components};return e?(0,o.jsx)(e,{...n,children:(0,o.jsx)(l,{...n})}):l(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>i,x:()=>r});var o=t(6540);const s={},a=o.createContext(s);function i(n){const e=o.useContext(a);return o.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:i(n.components),o.createElement(a.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/6d990bb1.2f8a890d.js b/assets/js/6d990bb1.2f8a890d.js deleted file mode 100644 index e08aec462..000000000 --- a/assets/js/6d990bb1.2f8a890d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2282],{7164:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"docSidebar":[{"type":"link","label":"Intro","href":"/starknet-devnet-rs/docs/next/intro","docId":"intro","unlisted":false},{"type":"category","label":"Running","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Install and run","href":"/starknet-devnet-rs/docs/next/running/install","docId":"running/install","unlisted":false},{"type":"link","label":"Run with Docker","href":"/starknet-devnet-rs/docs/next/running/docker","docId":"running/docker","unlisted":false},{"type":"link","label":"CLI options","href":"/starknet-devnet-rs/docs/next/running/cli","docId":"running/cli","unlisted":false}],"href":"/starknet-devnet-rs/docs/next/category/running"},{"type":"link","label":"Account impersonation","href":"/starknet-devnet-rs/docs/next/account-impersonation","docId":"account-impersonation","unlisted":false},{"type":"link","label":"API","href":"/starknet-devnet-rs/docs/next/api","docId":"api","unlisted":false},{"type":"link","label":"Account balance","href":"/starknet-devnet-rs/docs/next/balance","docId":"balance","unlisted":false},{"type":"link","label":"Blocks","href":"/starknet-devnet-rs/docs/next/blocks","docId":"blocks","unlisted":false},{"type":"link","label":"Dump, load, restart","href":"/starknet-devnet-rs/docs/next/dump-load-restart","docId":"dump-load-restart","unlisted":false},{"type":"link","label":"Forking","href":"/starknet-devnet-rs/docs/next/forking","docId":"forking","unlisted":false},{"type":"link","label":"Historic state support","href":"/starknet-devnet-rs/docs/next/historic-state","docId":"historic-state","unlisted":false},{"type":"link","label":"Lite mode","href":"/starknet-devnet-rs/docs/next/lite","docId":"lite","unlisted":false},{"type":"link","label":"L1-L2 interaction via Postman","href":"/starknet-devnet-rs/docs/next/postman","docId":"postman","unlisted":false},{"type":"link","label":"Predeployed contracts","href":"/starknet-devnet-rs/docs/next/predeployed","docId":"predeployed","unlisted":false},{"type":"link","label":"Server config","href":"/starknet-devnet-rs/docs/next/server-config","docId":"server-config","unlisted":false},{"type":"link","label":"Starknet time","href":"/starknet-devnet-rs/docs/next/starknet-time","docId":"starknet-time","unlisted":false}]},"docs":{"account-impersonation":{"id":"account-impersonation","title":"Account impersonation","description":"Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in forking mode.","sidebar":"docSidebar"},"api":{"id":"api","title":"API","description":"Starknet API","sidebar":"docSidebar"},"balance":{"id":"balance","title":"Account balance","description":"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.","sidebar":"docSidebar"},"blocks":{"id":"blocks","title":"Blocks","description":"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to forked block number plus one.","sidebar":"docSidebar"},"dump-load-restart":{"id":"dump-load-restart","title":"Dump, load, restart","description":"Dumping","sidebar":"docSidebar"},"forking":{"id":"forking","title":"Forking","description":"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.","sidebar":"docSidebar"},"historic-state":{"id":"historic-state","title":"Historic state support","description":"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.","sidebar":"docSidebar"},"intro":{"id":"intro","title":"Intro","description":"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!","sidebar":"docSidebar"},"lite":{"id":"lite","title":"Lite mode","description":"To run Devnet in a minimal lite mode, provide the flag:","sidebar":"docSidebar"},"postman":{"id":"postman","title":"L1-L2 interaction via Postman","description":"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.","sidebar":"docSidebar"},"predeployed":{"id":"predeployed","title":"Predeployed contracts","description":"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.","sidebar":"docSidebar"},"running/cli":{"id":"running/cli","title":"CLI options","description":"Check out the CLI options with:","sidebar":"docSidebar"},"running/docker":{"id":"running/docker","title":"Run with Docker","description":"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:","sidebar":"docSidebar"},"running/install":{"id":"running/install","title":"Install and run","description":"Requirements","sidebar":"docSidebar"},"server-config":{"id":"server-config","title":"Server config","description":"Host and port","sidebar":"docSidebar"},"starknet-time":{"id":"starknet-time","title":"Starknet time","description":"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime and /increasetime generate a new block. This can be changed for /settime by setting the optional parameter generateblock to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.","sidebar":"docSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/6d990bb1.f8cd7091.js b/assets/js/6d990bb1.f8cd7091.js new file mode 100644 index 000000000..1a8c7e5b6 --- /dev/null +++ b/assets/js/6d990bb1.f8cd7091.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2282],{7164:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"docSidebar":[{"type":"link","label":"Intro","href":"/starknet-devnet-rs/docs/next/intro","docId":"intro","unlisted":false},{"type":"category","label":"Running","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Install and run","href":"/starknet-devnet-rs/docs/next/running/install","docId":"running/install","unlisted":false},{"type":"link","label":"Run with Docker","href":"/starknet-devnet-rs/docs/next/running/docker","docId":"running/docker","unlisted":false},{"type":"link","label":"CLI options","href":"/starknet-devnet-rs/docs/next/running/cli","docId":"running/cli","unlisted":false}],"href":"/starknet-devnet-rs/docs/next/category/running"},{"type":"link","label":"Account impersonation","href":"/starknet-devnet-rs/docs/next/account-impersonation","docId":"account-impersonation","unlisted":false},{"type":"link","label":"API","href":"/starknet-devnet-rs/docs/next/api","docId":"api","unlisted":false},{"type":"link","label":"Account balance","href":"/starknet-devnet-rs/docs/next/balance","docId":"balance","unlisted":false},{"type":"link","label":"Blocks","href":"/starknet-devnet-rs/docs/next/blocks","docId":"blocks","unlisted":false},{"type":"link","label":"Dump, load, restart","href":"/starknet-devnet-rs/docs/next/dump-load-restart","docId":"dump-load-restart","unlisted":false},{"type":"link","label":"Forking","href":"/starknet-devnet-rs/docs/next/forking","docId":"forking","unlisted":false},{"type":"link","label":"Historic state support","href":"/starknet-devnet-rs/docs/next/historic-state","docId":"historic-state","unlisted":false},{"type":"link","label":"Lite mode","href":"/starknet-devnet-rs/docs/next/lite","docId":"lite","unlisted":false},{"type":"link","label":"L1-L2 interaction via Postman","href":"/starknet-devnet-rs/docs/next/postman","docId":"postman","unlisted":false},{"type":"link","label":"Predeployed contracts","href":"/starknet-devnet-rs/docs/next/predeployed","docId":"predeployed","unlisted":false},{"type":"link","label":"Server config","href":"/starknet-devnet-rs/docs/next/server-config","docId":"server-config","unlisted":false},{"type":"link","label":"Starknet time","href":"/starknet-devnet-rs/docs/next/starknet-time","docId":"starknet-time","unlisted":false}]},"docs":{"account-impersonation":{"id":"account-impersonation","title":"Account impersonation","description":"This page is about account impersonation. To read about account class selection and deployment, click here.","sidebar":"docSidebar"},"api":{"id":"api","title":"API","description":"Starknet API","sidebar":"docSidebar"},"balance":{"id":"balance","title":"Account balance","description":"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.","sidebar":"docSidebar"},"blocks":{"id":"blocks","title":"Blocks","description":"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to forked block number plus one.","sidebar":"docSidebar"},"dump-load-restart":{"id":"dump-load-restart","title":"Dump, load, restart","description":"Dumping","sidebar":"docSidebar"},"forking":{"id":"forking","title":"Forking","description":"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.","sidebar":"docSidebar"},"historic-state":{"id":"historic-state","title":"Historic state support","description":"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.","sidebar":"docSidebar"},"intro":{"id":"intro","title":"Intro","description":"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!","sidebar":"docSidebar"},"lite":{"id":"lite","title":"Lite mode","description":"To run Devnet in a minimal lite mode, provide the flag:","sidebar":"docSidebar"},"postman":{"id":"postman","title":"L1-L2 interaction via Postman","description":"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.","sidebar":"docSidebar"},"predeployed":{"id":"predeployed","title":"Predeployed contracts","description":"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.","sidebar":"docSidebar"},"running/cli":{"id":"running/cli","title":"CLI options","description":"Check out the CLI options with:","sidebar":"docSidebar"},"running/docker":{"id":"running/docker","title":"Run with Docker","description":"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:","sidebar":"docSidebar"},"running/install":{"id":"running/install","title":"Install and run","description":"Requirements","sidebar":"docSidebar"},"server-config":{"id":"server-config","title":"Server config","description":"Host and port","sidebar":"docSidebar"},"starknet-time":{"id":"starknet-time","title":"Starknet time","description":"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime and /increasetime generate a new block. This can be changed for /settime by setting the optional parameter generateblock to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.","sidebar":"docSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/ae603a5f.2a13360e.js b/assets/js/ae603a5f.2a13360e.js deleted file mode 100644 index 79a57f1e4..000000000 --- a/assets/js/ae603a5f.2a13360e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4290],{415:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>i,contentTitle:()=>s,default:()=>p,frontMatter:()=>r,metadata:()=>d,toc:()=>a});var o=t(4848),c=t(8453);const r={},s="Predeployed contracts",d={id:"predeployed",title:"Predeployed contracts",description:"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.",source:"@site/versioned_docs/version-0.0.6/predeployed.md",sourceDirName:".",slug:"/predeployed",permalink:"/starknet-devnet-rs/docs/predeployed",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.6/predeployed.md",tags:[],version:"0.0.6",frontMatter:{},sidebar:"docSidebar",previous:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/postman"},next:{title:"Server config",permalink:"/starknet-devnet-rs/docs/server-config"}},i={},a=[{value:"Account class selection",id:"account-class-selection",level:2},{value:"How to get predeployment info?",id:"how-to-get-predeployment-info",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"predeployed-contracts",children:"Predeployed contracts"}),"\n",(0,o.jsxs)(n.p,{children:["Devnet predeploys a ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.6.1/udc",children:"UDC"}),", an ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.8.1/erc20",children:"ERC20 (fee token)"})," contract and a set of predeployed funded accounts."]}),"\n",(0,o.jsxs)(n.p,{children:["The set of accounts can be controlled via ",(0,o.jsx)(n.a,{href:"./running/cli",children:"CLI options"}),": ",(0,o.jsx)(n.code,{children:"--accounts "}),", ",(0,o.jsx)(n.code,{children:"--initial-balance "}),", ",(0,o.jsx)(n.code,{children:"--seed "}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"account-class-selection",children:"Account class selection"}),"\n",(0,o.jsx)(n.p,{children:"Choose between predeploying Cairo 0 (OpenZeppelin 0.5.1) or Cairo 1 (default; OpenZeppelin 0.8.1) accounts by using:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class [cairo0 | cairo1]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Alternatively, provide a path to the ",(0,o.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo#compiling-and-running-cairo-files",children:"Sierra artifact"})," of your custom account using:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class-custom \n"})}),"\n",(0,o.jsx)(n.h2,{id:"how-to-get-predeployment-info",children:"How to get predeployment info?"}),"\n",(0,o.jsxs)(n.p,{children:["The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a ",(0,o.jsx)(n.code,{children:"GET"})," request to ",(0,o.jsx)(n.code,{children:"/predeployed_accounts"})," of your Devnet."]})]})}function p(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>d});var o=t(6540);const c={},r=o.createContext(c);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ae603a5f.4890b38d.js b/assets/js/ae603a5f.4890b38d.js new file mode 100644 index 000000000..390bd908a --- /dev/null +++ b/assets/js/ae603a5f.4890b38d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4290],{415:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>p,frontMatter:()=>r,metadata:()=>a,toc:()=>i});var o=t(4848),c=t(8453);const r={},s="Predeployed contracts",a={id:"predeployed",title:"Predeployed contracts",description:"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.",source:"@site/versioned_docs/version-0.0.6/predeployed.md",sourceDirName:".",slug:"/predeployed",permalink:"/starknet-devnet-rs/docs/predeployed",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.6/predeployed.md",tags:[],version:"0.0.6",frontMatter:{},sidebar:"docSidebar",previous:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/postman"},next:{title:"Server config",permalink:"/starknet-devnet-rs/docs/server-config"}},d={},i=[{value:"Account class selection",id:"account-class-selection",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2},{value:"How to get predeployment info?",id:"how-to-get-predeployment-info",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"predeployed-contracts",children:"Predeployed contracts"}),"\n",(0,o.jsxs)(n.p,{children:["Devnet predeploys a ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.6.1/udc",children:"UDC"}),", an ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.8.1/erc20",children:"ERC20 (fee token)"})," contract and a set of predeployed funded accounts."]}),"\n",(0,o.jsxs)(n.p,{children:["The set of accounts can be controlled via ",(0,o.jsx)(n.a,{href:"./running/cli",children:"CLI options"}),": ",(0,o.jsx)(n.code,{children:"--accounts "}),", ",(0,o.jsx)(n.code,{children:"--initial-balance "}),", ",(0,o.jsx)(n.code,{children:"--seed "}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"account-class-selection",children:"Account class selection"}),"\n",(0,o.jsx)(n.p,{children:"Choose between predeploying Cairo 0 (OpenZeppelin 0.5.1) or Cairo 1 (default; OpenZeppelin 0.8.1) accounts by using:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class [cairo0 | cairo1]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Alternatively, provide a path to the ",(0,o.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo#compiling-and-running-cairo-files",children:"Sierra artifact"})," of your custom account using:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class-custom \n"})}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:["If you want to deploy an instance of an account contract class not predeclared on Devnet, you can use ",(0,o.jsx)(n.a,{href:"./forking",children:"forking"}),". Just fork an origin network which has the needed class already declared, e.g. the Sepolia testnet. Why? Because new versions of wallets like ArgentX and Braavos tend to be declared on testnet/mainnet soon after release."]}),"\n",(0,o.jsx)(n.h2,{id:"how-to-get-predeployment-info",children:"How to get predeployment info?"}),"\n",(0,o.jsxs)(n.p,{children:["The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a ",(0,o.jsx)(n.code,{children:"GET"})," request to ",(0,o.jsx)(n.code,{children:"/predeployed_accounts"})," of your Devnet."]})]})}function p(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var o=t(6540);const c={},r=o.createContext(c);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b4513eec.2a54a4d3.js b/assets/js/b4513eec.2a54a4d3.js new file mode 100644 index 000000000..209be0b55 --- /dev/null +++ b/assets/js/b4513eec.2a54a4d3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1863],{9025:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>p,frontMatter:()=>r,metadata:()=>a,toc:()=>i});var o=t(4848),c=t(8453);const r={},s="Predeployed contracts",a={id:"predeployed",title:"Predeployed contracts",description:"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.",source:"@site/docs/predeployed.md",sourceDirName:".",slug:"/predeployed",permalink:"/starknet-devnet-rs/docs/next/predeployed",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/predeployed.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/next/postman"},next:{title:"Server config",permalink:"/starknet-devnet-rs/docs/next/server-config"}},d={},i=[{value:"Account class selection",id:"account-class-selection",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2},{value:"How to get predeployment info?",id:"how-to-get-predeployment-info",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"predeployed-contracts",children:"Predeployed contracts"}),"\n",(0,o.jsxs)(n.p,{children:["Devnet predeploys a ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.6.1/udc",children:"UDC"}),", an ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.8.1/erc20",children:"ERC20 (fee token)"})," contract and a set of predeployed funded accounts."]}),"\n",(0,o.jsxs)(n.p,{children:["The set of accounts can be controlled via ",(0,o.jsx)(n.a,{href:"./running/cli",children:"CLI options"}),": ",(0,o.jsx)(n.code,{children:"--accounts "}),", ",(0,o.jsx)(n.code,{children:"--initial-balance "}),", ",(0,o.jsx)(n.code,{children:"--seed "}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"account-class-selection",children:"Account class selection"}),"\n",(0,o.jsx)(n.p,{children:"Choose between predeploying Cairo 0 (OpenZeppelin 0.5.1) or Cairo 1 (default; OpenZeppelin 0.8.1) accounts by using:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class [cairo0 | cairo1]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Alternatively, provide a path to the ",(0,o.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo#compiling-and-running-cairo-files",children:"Sierra artifact"})," of your custom account using:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class-custom \n"})}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:["If you want to deploy an instance of an account contract class not predeclared on Devnet, you can use ",(0,o.jsx)(n.a,{href:"./forking",children:"forking"}),". Just fork an origin network which has the needed class already declared, e.g. the Sepolia testnet. Why? Because new versions of wallets like ArgentX and Braavos tend to be declared on testnet/mainnet soon after release."]}),"\n",(0,o.jsx)(n.h2,{id:"how-to-get-predeployment-info",children:"How to get predeployment info?"}),"\n",(0,o.jsxs)(n.p,{children:["The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a ",(0,o.jsx)(n.code,{children:"GET"})," request to ",(0,o.jsx)(n.code,{children:"/predeployed_accounts"})," of your Devnet."]})]})}function p(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var o=t(6540);const c={},r=o.createContext(c);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b4513eec.72d842e1.js b/assets/js/b4513eec.72d842e1.js deleted file mode 100644 index abe8d3461..000000000 --- a/assets/js/b4513eec.72d842e1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1863],{9025:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>i,contentTitle:()=>s,default:()=>p,frontMatter:()=>r,metadata:()=>d,toc:()=>a});var o=t(4848),c=t(8453);const r={},s="Predeployed contracts",d={id:"predeployed",title:"Predeployed contracts",description:"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.",source:"@site/docs/predeployed.md",sourceDirName:".",slug:"/predeployed",permalink:"/starknet-devnet-rs/docs/next/predeployed",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/predeployed.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/next/postman"},next:{title:"Server config",permalink:"/starknet-devnet-rs/docs/next/server-config"}},i={},a=[{value:"Account class selection",id:"account-class-selection",level:2},{value:"How to get predeployment info?",id:"how-to-get-predeployment-info",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"predeployed-contracts",children:"Predeployed contracts"}),"\n",(0,o.jsxs)(n.p,{children:["Devnet predeploys a ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.6.1/udc",children:"UDC"}),", an ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.8.1/erc20",children:"ERC20 (fee token)"})," contract and a set of predeployed funded accounts."]}),"\n",(0,o.jsxs)(n.p,{children:["The set of accounts can be controlled via ",(0,o.jsx)(n.a,{href:"./running/cli",children:"CLI options"}),": ",(0,o.jsx)(n.code,{children:"--accounts "}),", ",(0,o.jsx)(n.code,{children:"--initial-balance "}),", ",(0,o.jsx)(n.code,{children:"--seed "}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"account-class-selection",children:"Account class selection"}),"\n",(0,o.jsx)(n.p,{children:"Choose between predeploying Cairo 0 (OpenZeppelin 0.5.1) or Cairo 1 (default; OpenZeppelin 0.8.1) accounts by using:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class [cairo0 | cairo1]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Alternatively, provide a path to the ",(0,o.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo#compiling-and-running-cairo-files",children:"Sierra artifact"})," of your custom account using:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class-custom \n"})}),"\n",(0,o.jsx)(n.h2,{id:"how-to-get-predeployment-info",children:"How to get predeployment info?"}),"\n",(0,o.jsxs)(n.p,{children:["The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a ",(0,o.jsx)(n.code,{children:"GET"})," request to ",(0,o.jsx)(n.code,{children:"/predeployed_accounts"})," of your Devnet."]})]})}function p(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>d});var o=t(6540);const c={},r=o.createContext(c);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b7bb6147.7b643943.js b/assets/js/b7bb6147.7b643943.js new file mode 100644 index 000000000..d330b3be8 --- /dev/null +++ b/assets/js/b7bb6147.7b643943.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[134],{4214:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>a,metadata:()=>r,toc:()=>d});var o=t(4848),s=t(8453);const a={},i="Account impersonation",r={id:"account-impersonation",title:"Account impersonation",description:"This page is about account impersonation. To read about account class selection and deployment, click here.",source:"@site/versioned_docs/version-0.0.6/account-impersonation.md",sourceDirName:".",slug:"/account-impersonation",permalink:"/starknet-devnet-rs/docs/account-impersonation",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.6/account-impersonation.md",tags:[],version:"0.0.6",frontMatter:{},sidebar:"docSidebar",previous:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/running/cli"},next:{title:"API",permalink:"/starknet-devnet-rs/docs/api"}},c={},d=[{value:"API",id:"api",level:2},{value:"devnet_impersonateAccount",id:"devnet_impersonateaccount",level:3},{value:"devnet_stopImpersonateAccount",id:"devnet_stopimpersonateaccount",level:3},{value:"devnet_autoImpersonate",id:"devnet_autoimpersonate",level:3},{value:"devnet_stopAutoImpersonate",id:"devnet_stopautoimpersonate",level:3}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsxs)(n.p,{children:["This page is about account impersonation. To read about account class selection and deployment, click ",(0,o.jsx)(n.a,{href:"./predeployed",children:"here"}),"."]})}),"\n",(0,o.jsxs)(n.p,{children:["Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in ",(0,o.jsx)(n.a,{href:"/starknet-devnet-rs/docs/forking",children:"forking mode"}),"."]}),"\n",(0,o.jsx)(n.admonition,{title:"Caveat",type:"warning",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Only ",(0,o.jsx)(n.code,{children:"INVOKE"})," and ",(0,o.jsx)(n.code,{children:"DECLARE"})," transactions are supported. ",(0,o.jsx)(n.code,{children:"DEPLOY_ACCOUNT"})," transaction is not supported, but you can create an ",(0,o.jsx)(n.code,{children:"INVOKE"})," transaction to UDC."]}),"\n",(0,o.jsx)(n.li,{children:"Overall fee, for transactions sent with an impersonated account, will be lower compared to normal transactions. The reason is that validation part is skipped."}),"\n",(0,o.jsxs)(n.li,{children:["The most common way of sending a transaction is via starknet-rs/starknet.js or starkli. Trying to send with an account that ",(0,o.jsx)(n.strong,{children:"does not"})," exist even in the origin network will return an error:","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["In transaction construction, if account nonce is not hardcoded, Devnet is queried and returns ",(0,o.jsx)(n.code,{children:"ContractNotFound"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Otherwise the nonce fetching part is skipped and ",(0,o.jsx)(n.code,{children:"InsufficientAccountBalance"})," is returned."]}),"\n"]}),"\n"]}),"\n"]})}),"\n",(0,o.jsx)(n.h2,{id:"api",children:"API"}),"\n",(0,o.jsx)(n.p,{children:"Account impersonation follows JSON-RPC method specification. Each method returns an empty response:"}),"\n",(0,o.jsx)(n.h3,{id:"devnet_impersonateaccount",children:"devnet_impersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Impersonates a specific account address nonexistent in the local state."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_impersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopimpersonateaccount",children:"devnet_stopImpersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Stops the impersonation of an account previously marked for impersonation."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopImpersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_autoimpersonate",children:"devnet_autoImpersonate"}),"\n",(0,o.jsx)(n.p,{children:"Enables automatic account impersonation. Every account that does not exist in the local state will be impersonated."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_autoImpersonate",\n "params": {}\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopautoimpersonate",children:"devnet_stopAutoImpersonate"}),"\n",(0,o.jsxs)(n.p,{children:["Stops the effect of ",(0,o.jsx)(n.a,{href:"#devnet_autoimpersonate",children:"automatic impersonation"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopAutoImpersonate",\n "params": {}\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>r});var o=t(6540);const s={},a=o.createContext(s);function i(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b7bb6147.b6f12338.js b/assets/js/b7bb6147.b6f12338.js deleted file mode 100644 index 704bc7dcd..000000000 --- a/assets/js/b7bb6147.b6f12338.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[134],{4214:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>a,metadata:()=>r,toc:()=>d});var o=t(4848),s=t(8453);const a={},i="Account impersonation",r={id:"account-impersonation",title:"Account impersonation",description:"Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in forking mode.",source:"@site/versioned_docs/version-0.0.6/account-impersonation.md",sourceDirName:".",slug:"/account-impersonation",permalink:"/starknet-devnet-rs/docs/account-impersonation",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.6/account-impersonation.md",tags:[],version:"0.0.6",frontMatter:{},sidebar:"docSidebar",previous:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/running/cli"},next:{title:"API",permalink:"/starknet-devnet-rs/docs/api"}},c={},d=[{value:"API",id:"api",level:2},{value:"devnet_impersonateAccount",id:"devnet_impersonateaccount",level:3},{value:"devnet_stopImpersonateAccount",id:"devnet_stopimpersonateaccount",level:3},{value:"devnet_autoImpersonate",id:"devnet_autoimpersonate",level:3},{value:"devnet_stopAutoImpersonate",id:"devnet_stopautoimpersonate",level:3}];function l(n){const e={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...n.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.h1,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsxs)(e.p,{children:["Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in ",(0,o.jsx)(e.a,{href:"/starknet-devnet-rs/docs/forking",children:"forking mode"}),"."]}),"\n",(0,o.jsx)(e.admonition,{title:"Caveat",type:"warning",children:(0,o.jsxs)(e.ul,{children:["\n",(0,o.jsxs)(e.li,{children:["Only ",(0,o.jsx)(e.code,{children:"INVOKE"})," and ",(0,o.jsx)(e.code,{children:"DECLARE"})," transactions are supported. ",(0,o.jsx)(e.code,{children:"DEPLOY_ACCOUNT"})," transaction is not supported, but you can create an ",(0,o.jsx)(e.code,{children:"INVOKE"})," transaction to UDC."]}),"\n",(0,o.jsx)(e.li,{children:"Overall fee, for transactions sent with an impersonated account, will be lower compared to normal transactions. The reason is that validation part is skipped."}),"\n",(0,o.jsxs)(e.li,{children:["The most common way of sending a transaction is via starknet-rs/starknet.js or starkli. Trying to send with an account that ",(0,o.jsx)(e.strong,{children:"does not"})," exist even in the origin network will return an error:","\n",(0,o.jsxs)(e.ul,{children:["\n",(0,o.jsxs)(e.li,{children:["In transaction construction, if account nonce is not hardcoded, Devnet is queried and returns ",(0,o.jsx)(e.code,{children:"ContractNotFound"}),"."]}),"\n",(0,o.jsxs)(e.li,{children:["Otherwise the nonce fetching part is skipped and ",(0,o.jsx)(e.code,{children:"InsufficientAccountBalance"})," is returned."]}),"\n"]}),"\n"]}),"\n"]})}),"\n",(0,o.jsx)(e.h2,{id:"api",children:"API"}),"\n",(0,o.jsx)(e.p,{children:"Account impersonation follows JSON-RPC method specification. Each method returns an empty response:"}),"\n",(0,o.jsx)(e.h3,{id:"devnet_impersonateaccount",children:"devnet_impersonateAccount"}),"\n",(0,o.jsx)(e.p,{children:"Impersonates a specific account address nonexistent in the local state."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_impersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_stopimpersonateaccount",children:"devnet_stopImpersonateAccount"}),"\n",(0,o.jsx)(e.p,{children:"Stops the impersonation of an account previously marked for impersonation."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopImpersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_autoimpersonate",children:"devnet_autoImpersonate"}),"\n",(0,o.jsx)(e.p,{children:"Enables automatic account impersonation. Every account that does not exist in the local state will be impersonated."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_autoImpersonate",\n "params": {}\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_stopautoimpersonate",children:"devnet_stopAutoImpersonate"}),"\n",(0,o.jsxs)(e.p,{children:["Stops the effect of ",(0,o.jsx)(e.a,{href:"#devnet_autoimpersonate",children:"automatic impersonation"}),"."]}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopAutoImpersonate",\n "params": {}\n}\n'})})]})}function p(n={}){const{wrapper:e}={...(0,s.R)(),...n.components};return e?(0,o.jsx)(e,{...n,children:(0,o.jsx)(l,{...n})}):l(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>i,x:()=>r});var o=t(6540);const s={},a=o.createContext(s);function i(n){const e=o.useContext(a);return o.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:i(n.components),o.createElement(a.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/cc2baa30.90bb1970.js b/assets/js/cc2baa30.90bb1970.js deleted file mode 100644 index 03731ea4b..000000000 --- a/assets/js/cc2baa30.90bb1970.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9218],{8947:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"0.0.6","label":"0.0.6","banner":null,"badge":true,"noIndex":false,"className":"docs-version-0.0.6","isLast":true,"docsSidebars":{"docSidebar":[{"type":"link","label":"Intro","href":"/starknet-devnet-rs/docs/intro","docId":"intro","unlisted":false},{"type":"category","label":"Running","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Install and run","href":"/starknet-devnet-rs/docs/running/install","docId":"running/install","unlisted":false},{"type":"link","label":"Run with Docker","href":"/starknet-devnet-rs/docs/running/docker","docId":"running/docker","unlisted":false},{"type":"link","label":"CLI options","href":"/starknet-devnet-rs/docs/running/cli","docId":"running/cli","unlisted":false}],"href":"/starknet-devnet-rs/docs/category/running"},{"type":"link","label":"Account impersonation","href":"/starknet-devnet-rs/docs/account-impersonation","docId":"account-impersonation","unlisted":false},{"type":"link","label":"API","href":"/starknet-devnet-rs/docs/api","docId":"api","unlisted":false},{"type":"link","label":"Account balance","href":"/starknet-devnet-rs/docs/balance","docId":"balance","unlisted":false},{"type":"link","label":"Blocks","href":"/starknet-devnet-rs/docs/blocks","docId":"blocks","unlisted":false},{"type":"link","label":"Dump, load, restart","href":"/starknet-devnet-rs/docs/dump-load-restart","docId":"dump-load-restart","unlisted":false},{"type":"link","label":"Forking","href":"/starknet-devnet-rs/docs/forking","docId":"forking","unlisted":false},{"type":"link","label":"Historic state support","href":"/starknet-devnet-rs/docs/historic-state","docId":"historic-state","unlisted":false},{"type":"link","label":"Lite mode","href":"/starknet-devnet-rs/docs/lite","docId":"lite","unlisted":false},{"type":"link","label":"L1-L2 interaction via Postman","href":"/starknet-devnet-rs/docs/postman","docId":"postman","unlisted":false},{"type":"link","label":"Predeployed contracts","href":"/starknet-devnet-rs/docs/predeployed","docId":"predeployed","unlisted":false},{"type":"link","label":"Server config","href":"/starknet-devnet-rs/docs/server-config","docId":"server-config","unlisted":false},{"type":"link","label":"Starknet time","href":"/starknet-devnet-rs/docs/starknet-time","docId":"starknet-time","unlisted":false}]},"docs":{"account-impersonation":{"id":"account-impersonation","title":"Account impersonation","description":"Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in forking mode.","sidebar":"docSidebar"},"api":{"id":"api","title":"API","description":"Starknet API","sidebar":"docSidebar"},"balance":{"id":"balance","title":"Account balance","description":"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.","sidebar":"docSidebar"},"blocks":{"id":"blocks","title":"Blocks","description":"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to forked block number plus one.","sidebar":"docSidebar"},"dump-load-restart":{"id":"dump-load-restart","title":"Dump, load, restart","description":"Dumping","sidebar":"docSidebar"},"forking":{"id":"forking","title":"Forking","description":"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.","sidebar":"docSidebar"},"historic-state":{"id":"historic-state","title":"Historic state support","description":"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.","sidebar":"docSidebar"},"intro":{"id":"intro","title":"Intro","description":"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!","sidebar":"docSidebar"},"lite":{"id":"lite","title":"Lite mode","description":"To run Devnet in a minimal lite mode, provide the flag:","sidebar":"docSidebar"},"postman":{"id":"postman","title":"L1-L2 interaction via Postman","description":"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.","sidebar":"docSidebar"},"predeployed":{"id":"predeployed","title":"Predeployed contracts","description":"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.","sidebar":"docSidebar"},"running/cli":{"id":"running/cli","title":"CLI options","description":"Check out the CLI options with:","sidebar":"docSidebar"},"running/docker":{"id":"running/docker","title":"Run with Docker","description":"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:","sidebar":"docSidebar"},"running/install":{"id":"running/install","title":"Install and run","description":"Requirements","sidebar":"docSidebar"},"server-config":{"id":"server-config","title":"Server config","description":"Host and port","sidebar":"docSidebar"},"starknet-time":{"id":"starknet-time","title":"Starknet time","description":"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime and /increasetime generate a new block. This can be changed for /settime by setting the optional parameter generateblock to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.","sidebar":"docSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/cc2baa30.c2a5635a.js b/assets/js/cc2baa30.c2a5635a.js new file mode 100644 index 000000000..6b3437318 --- /dev/null +++ b/assets/js/cc2baa30.c2a5635a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9218],{8947:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"0.0.6","label":"0.0.6","banner":null,"badge":true,"noIndex":false,"className":"docs-version-0.0.6","isLast":true,"docsSidebars":{"docSidebar":[{"type":"link","label":"Intro","href":"/starknet-devnet-rs/docs/intro","docId":"intro","unlisted":false},{"type":"category","label":"Running","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Install and run","href":"/starknet-devnet-rs/docs/running/install","docId":"running/install","unlisted":false},{"type":"link","label":"Run with Docker","href":"/starknet-devnet-rs/docs/running/docker","docId":"running/docker","unlisted":false},{"type":"link","label":"CLI options","href":"/starknet-devnet-rs/docs/running/cli","docId":"running/cli","unlisted":false}],"href":"/starknet-devnet-rs/docs/category/running"},{"type":"link","label":"Account impersonation","href":"/starknet-devnet-rs/docs/account-impersonation","docId":"account-impersonation","unlisted":false},{"type":"link","label":"API","href":"/starknet-devnet-rs/docs/api","docId":"api","unlisted":false},{"type":"link","label":"Account balance","href":"/starknet-devnet-rs/docs/balance","docId":"balance","unlisted":false},{"type":"link","label":"Blocks","href":"/starknet-devnet-rs/docs/blocks","docId":"blocks","unlisted":false},{"type":"link","label":"Dump, load, restart","href":"/starknet-devnet-rs/docs/dump-load-restart","docId":"dump-load-restart","unlisted":false},{"type":"link","label":"Forking","href":"/starknet-devnet-rs/docs/forking","docId":"forking","unlisted":false},{"type":"link","label":"Historic state support","href":"/starknet-devnet-rs/docs/historic-state","docId":"historic-state","unlisted":false},{"type":"link","label":"Lite mode","href":"/starknet-devnet-rs/docs/lite","docId":"lite","unlisted":false},{"type":"link","label":"L1-L2 interaction via Postman","href":"/starknet-devnet-rs/docs/postman","docId":"postman","unlisted":false},{"type":"link","label":"Predeployed contracts","href":"/starknet-devnet-rs/docs/predeployed","docId":"predeployed","unlisted":false},{"type":"link","label":"Server config","href":"/starknet-devnet-rs/docs/server-config","docId":"server-config","unlisted":false},{"type":"link","label":"Starknet time","href":"/starknet-devnet-rs/docs/starknet-time","docId":"starknet-time","unlisted":false}]},"docs":{"account-impersonation":{"id":"account-impersonation","title":"Account impersonation","description":"This page is about account impersonation. To read about account class selection and deployment, click here.","sidebar":"docSidebar"},"api":{"id":"api","title":"API","description":"Starknet API","sidebar":"docSidebar"},"balance":{"id":"balance","title":"Account balance","description":"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.","sidebar":"docSidebar"},"blocks":{"id":"blocks","title":"Blocks","description":"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to forked block number plus one.","sidebar":"docSidebar"},"dump-load-restart":{"id":"dump-load-restart","title":"Dump, load, restart","description":"Dumping","sidebar":"docSidebar"},"forking":{"id":"forking","title":"Forking","description":"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.","sidebar":"docSidebar"},"historic-state":{"id":"historic-state","title":"Historic state support","description":"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.","sidebar":"docSidebar"},"intro":{"id":"intro","title":"Intro","description":"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!","sidebar":"docSidebar"},"lite":{"id":"lite","title":"Lite mode","description":"To run Devnet in a minimal lite mode, provide the flag:","sidebar":"docSidebar"},"postman":{"id":"postman","title":"L1-L2 interaction via Postman","description":"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.","sidebar":"docSidebar"},"predeployed":{"id":"predeployed","title":"Predeployed contracts","description":"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.","sidebar":"docSidebar"},"running/cli":{"id":"running/cli","title":"CLI options","description":"Check out the CLI options with:","sidebar":"docSidebar"},"running/docker":{"id":"running/docker","title":"Run with Docker","description":"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:","sidebar":"docSidebar"},"running/install":{"id":"running/install","title":"Install and run","description":"Requirements","sidebar":"docSidebar"},"server-config":{"id":"server-config","title":"Server config","description":"Host and port","sidebar":"docSidebar"},"starknet-time":{"id":"starknet-time","title":"Starknet time","description":"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime and /increasetime generate a new block. This can be changed for /settime by setting the optional parameter generateblock to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.","sidebar":"docSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.9ea578d4.js b/assets/js/runtime~main.d7edede7.js similarity index 92% rename from assets/js/runtime~main.9ea578d4.js rename to assets/js/runtime~main.d7edede7.js index f1730f21d..8e96f4583 100644 --- a/assets/js/runtime~main.9ea578d4.js +++ b/assets/js/runtime~main.d7edede7.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,t,b,r,c={},d={};function f(e){var a=d[e];if(void 0!==a)return a.exports;var t=d[e]={id:e,loaded:!1,exports:{}};return c[e].call(t.exports,t,t.exports,f),t.loaded=!0,t.exports}f.m=c,f.c=d,e=[],f.O=(a,t,b,r)=>{if(!t){var c=1/0;for(i=0;i=r)&&Object.keys(f.O).every((e=>f.O[e](t[o])))?t.splice(o--,1):(d=!1,r0&&e[i-1][2]>r;i--)e[i]=e[i-1];e[i]=[t,b,r]},f.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return f.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,b){if(1&b&&(e=this(e)),8&b)return e;if("object"==typeof e&&e){if(4&b&&e.__esModule)return e;if(16&b&&"function"==typeof e.then)return e}var r=Object.create(null);f.r(r);var c={};a=a||[null,t({}),t([]),t(t)];for(var d=2&b&&e;"object"==typeof d&&!~a.indexOf(d);d=t(d))Object.getOwnPropertyNames(d).forEach((a=>c[a]=()=>e[a]));return c.default=()=>e,f.d(r,c),r},f.d=(e,a)=>{for(var t in a)f.o(a,t)&&!f.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce(((a,t)=>(f.f[t](e,a),a)),[])),f.u=e=>"assets/js/"+({134:"b7bb6147",337:"3f194bb7",463:"682c6856",562:"5fadd32f",598:"c25a813d",646:"7b998695",952:"2d66ba60",1235:"a7456010",1316:"1b560adb",1527:"778bcc8b",1863:"b4513eec",1914:"1151f991",2282:"6d990bb1",2627:"4769fc4e",2871:"3c883fc4",3332:"e28eadbb",3956:"a0ea14c4",3976:"0e384e19",4134:"393be207",4290:"ae603a5f",4583:"1df93b7f",4676:"24503201",4876:"17682634",5120:"a5ad27b1",5186:"b0477c6d",5480:"80526ee6",5700:"b9f7b2ab",5742:"aba21aa0",5771:"8f2e4180",5960:"0657c530",6061:"1f391b9e",6187:"e44e17f8",6828:"9976ff42",6900:"cc3979e2",6969:"14eb3368",7098:"a7bd4aaa",7229:"eb78b783",7230:"93f75803",7624:"5fbc5cf1",8401:"17896441",8626:"bca784a7",9048:"a94703ab",9218:"cc2baa30",9378:"5b870ab8",9440:"8d820236",9647:"5e95c892"}[e]||e)+"."+{134:"b6f12338",337:"0144ea02",463:"a9ba8ef1",562:"f01f946b",598:"3c832b8e",646:"ba2beb82",952:"709cdb58",1235:"7b4b0a20",1316:"6c6b1f0e",1527:"dd9974ab",1863:"72d842e1",1914:"2cdeffc0",2237:"ede9a640",2282:"2f8a890d",2627:"1c15b3f8",2871:"d516223c",3332:"4dd57af2",3658:"e4ca47ec",3956:"94e319da",3976:"5aa906b8",4134:"030d51d7",4290:"2a13360e",4583:"f182b925",4676:"bb859ed4",4876:"7fb54312",5120:"67d97cd9",5186:"e14ade79",5480:"ba93d316",5700:"64cf4bd1",5742:"9ac6642b",5771:"6fb725c9",5960:"aa8fdf00",6061:"68f8d4d4",6187:"c49d81b4",6828:"efe8bc09",6900:"f2efdc37",6969:"eeb6b7e2",7098:"b82ee0df",7229:"33a8bdeb",7230:"ce271db6",7624:"8e7fc6bf",8401:"4295b40f",8626:"0345585f",9048:"2668bc5b",9218:"90bb1970",9378:"c92e0a02",9440:"d1300806",9647:"b1f5748f"}[e]+".js",f.miniCssF=e=>{},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),b={},r="website:",f.l=(e,a,t,c)=>{if(b[e])b[e].push(a);else{var d,o;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i{d.onerror=d.onload=null,clearTimeout(s);var r=b[e];if(delete b[e],d.parentNode&&d.parentNode.removeChild(d),r&&r.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=l.bind(null,d.onerror),d.onload=l.bind(null,d.onload),o&&document.head.appendChild(d)}},f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/starknet-devnet-rs/",f.gca=function(e){return e={17682634:"4876",17896441:"8401",24503201:"4676",b7bb6147:"134","3f194bb7":"337","682c6856":"463","5fadd32f":"562",c25a813d:"598","7b998695":"646","2d66ba60":"952",a7456010:"1235","1b560adb":"1316","778bcc8b":"1527",b4513eec:"1863","1151f991":"1914","6d990bb1":"2282","4769fc4e":"2627","3c883fc4":"2871",e28eadbb:"3332",a0ea14c4:"3956","0e384e19":"3976","393be207":"4134",ae603a5f:"4290","1df93b7f":"4583",a5ad27b1:"5120",b0477c6d:"5186","80526ee6":"5480",b9f7b2ab:"5700",aba21aa0:"5742","8f2e4180":"5771","0657c530":"5960","1f391b9e":"6061",e44e17f8:"6187","9976ff42":"6828",cc3979e2:"6900","14eb3368":"6969",a7bd4aaa:"7098",eb78b783:"7229","93f75803":"7230","5fbc5cf1":"7624",bca784a7:"8626",a94703ab:"9048",cc2baa30:"9218","5b870ab8":"9378","8d820236":"9440","5e95c892":"9647"}[e]||e,f.p+f.u(e)},(()=>{var e={5354:0,1869:0};f.f.j=(a,t)=>{var b=f.o(e,a)?e[a]:void 0;if(0!==b)if(b)t.push(b[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var r=new Promise(((t,r)=>b=e[a]=[t,r]));t.push(b[2]=r);var c=f.p+f.u(a),d=new Error;f.l(c,(t=>{if(f.o(e,a)&&(0!==(b=e[a])&&(e[a]=void 0),b)){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;d.message="Loading chunk "+a+" failed.\n("+r+": "+c+")",d.name="ChunkLoadError",d.type=r,d.request=c,b[1](d)}}),"chunk-"+a,a)}},f.O.j=a=>0===e[a];var a=(a,t)=>{var b,r,c=t[0],d=t[1],o=t[2],n=0;if(c.some((a=>0!==e[a]))){for(b in d)f.o(d,b)&&(f.m[b]=d[b]);if(o)var i=o(f)}for(a&&a(t);n{"use strict";var e,a,t,b,r,c={},d={};function f(e){var a=d[e];if(void 0!==a)return a.exports;var t=d[e]={id:e,loaded:!1,exports:{}};return c[e].call(t.exports,t,t.exports,f),t.loaded=!0,t.exports}f.m=c,f.c=d,e=[],f.O=(a,t,b,r)=>{if(!t){var c=1/0;for(i=0;i=r)&&Object.keys(f.O).every((e=>f.O[e](t[o])))?t.splice(o--,1):(d=!1,r0&&e[i-1][2]>r;i--)e[i]=e[i-1];e[i]=[t,b,r]},f.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return f.d(a,{a:a}),a},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,b){if(1&b&&(e=this(e)),8&b)return e;if("object"==typeof e&&e){if(4&b&&e.__esModule)return e;if(16&b&&"function"==typeof e.then)return e}var r=Object.create(null);f.r(r);var c={};a=a||[null,t({}),t([]),t(t)];for(var d=2&b&&e;"object"==typeof d&&!~a.indexOf(d);d=t(d))Object.getOwnPropertyNames(d).forEach((a=>c[a]=()=>e[a]));return c.default=()=>e,f.d(r,c),r},f.d=(e,a)=>{for(var t in a)f.o(a,t)&&!f.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce(((a,t)=>(f.f[t](e,a),a)),[])),f.u=e=>"assets/js/"+({134:"b7bb6147",337:"3f194bb7",463:"682c6856",562:"5fadd32f",598:"c25a813d",646:"7b998695",952:"2d66ba60",1235:"a7456010",1316:"1b560adb",1527:"778bcc8b",1863:"b4513eec",1914:"1151f991",2282:"6d990bb1",2627:"4769fc4e",2871:"3c883fc4",3332:"e28eadbb",3956:"a0ea14c4",3976:"0e384e19",4134:"393be207",4290:"ae603a5f",4583:"1df93b7f",4676:"24503201",4876:"17682634",5120:"a5ad27b1",5186:"b0477c6d",5480:"80526ee6",5700:"b9f7b2ab",5742:"aba21aa0",5771:"8f2e4180",5960:"0657c530",6061:"1f391b9e",6187:"e44e17f8",6828:"9976ff42",6900:"cc3979e2",6969:"14eb3368",7098:"a7bd4aaa",7229:"eb78b783",7230:"93f75803",7624:"5fbc5cf1",8401:"17896441",8626:"bca784a7",9048:"a94703ab",9218:"cc2baa30",9378:"5b870ab8",9440:"8d820236",9647:"5e95c892"}[e]||e)+"."+{134:"7b643943",337:"0144ea02",463:"a9ba8ef1",562:"526f0254",598:"3c832b8e",646:"ba2beb82",952:"5554bca5",1235:"7b4b0a20",1316:"6c6b1f0e",1527:"dd9974ab",1863:"2a54a4d3",1914:"2cdeffc0",2237:"ede9a640",2282:"f8cd7091",2627:"1c15b3f8",2871:"36877ea9",3332:"4dd57af2",3658:"e4ca47ec",3956:"94e319da",3976:"5aa906b8",4134:"030d51d7",4290:"4890b38d",4583:"f182b925",4676:"bb859ed4",4876:"7fb54312",5120:"67d97cd9",5186:"e14ade79",5480:"ba93d316",5700:"64cf4bd1",5742:"9ac6642b",5771:"6fb725c9",5960:"aa8fdf00",6061:"68f8d4d4",6187:"c49d81b4",6828:"efe8bc09",6900:"f2efdc37",6969:"eeb6b7e2",7098:"b82ee0df",7229:"33a8bdeb",7230:"ce271db6",7624:"8e7fc6bf",8401:"4295b40f",8626:"0345585f",9048:"2668bc5b",9218:"c2a5635a",9378:"c92e0a02",9440:"d1300806",9647:"b1f5748f"}[e]+".js",f.miniCssF=e=>{},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),b={},r="website:",f.l=(e,a,t,c)=>{if(b[e])b[e].push(a);else{var d,o;if(void 0!==t)for(var n=document.getElementsByTagName("script"),i=0;i{d.onerror=d.onload=null,clearTimeout(s);var r=b[e];if(delete b[e],d.parentNode&&d.parentNode.removeChild(d),r&&r.forEach((e=>e(t))),a)return a(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=l.bind(null,d.onerror),d.onload=l.bind(null,d.onload),o&&document.head.appendChild(d)}},f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/starknet-devnet-rs/",f.gca=function(e){return e={17682634:"4876",17896441:"8401",24503201:"4676",b7bb6147:"134","3f194bb7":"337","682c6856":"463","5fadd32f":"562",c25a813d:"598","7b998695":"646","2d66ba60":"952",a7456010:"1235","1b560adb":"1316","778bcc8b":"1527",b4513eec:"1863","1151f991":"1914","6d990bb1":"2282","4769fc4e":"2627","3c883fc4":"2871",e28eadbb:"3332",a0ea14c4:"3956","0e384e19":"3976","393be207":"4134",ae603a5f:"4290","1df93b7f":"4583",a5ad27b1:"5120",b0477c6d:"5186","80526ee6":"5480",b9f7b2ab:"5700",aba21aa0:"5742","8f2e4180":"5771","0657c530":"5960","1f391b9e":"6061",e44e17f8:"6187","9976ff42":"6828",cc3979e2:"6900","14eb3368":"6969",a7bd4aaa:"7098",eb78b783:"7229","93f75803":"7230","5fbc5cf1":"7624",bca784a7:"8626",a94703ab:"9048",cc2baa30:"9218","5b870ab8":"9378","8d820236":"9440","5e95c892":"9647"}[e]||e,f.p+f.u(e)},(()=>{var e={5354:0,1869:0};f.f.j=(a,t)=>{var b=f.o(e,a)?e[a]:void 0;if(0!==b)if(b)t.push(b[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var r=new Promise(((t,r)=>b=e[a]=[t,r]));t.push(b[2]=r);var c=f.p+f.u(a),d=new Error;f.l(c,(t=>{if(f.o(e,a)&&(0!==(b=e[a])&&(e[a]=void 0),b)){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;d.message="Loading chunk "+a+" failed.\n("+r+": "+c+")",d.name="ChunkLoadError",d.type=r,d.request=c,b[1](d)}}),"chunk-"+a,a)}},f.O.j=a=>0===e[a];var a=(a,t)=>{var b,r,c=t[0],d=t[1],o=t[2],n=0;if(c.some((a=>0!==e[a]))){for(b in d)f.o(d,b)&&(f.m[b]=d[b]);if(o)var i=o(f)}for(a&&a(t);n -Account impersonation | Starknet Devnet - +Account impersonation | Starknet Devnet +
Version: 0.0.6

Account impersonation

+
info

This page is about account impersonation. To read about account class selection and deployment, click here.

Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in forking mode.

Caveat
  • Only INVOKE and DECLARE transactions are supported. DEPLOY_ACCOUNT transaction is not supported, but you can create an INVOKE transaction to UDC.
  • diff --git a/docs/api/index.html b/docs/api/index.html index 4f86cc622..784696c4e 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -4,7 +4,7 @@ API | Starknet Devnet - + diff --git a/docs/balance/index.html b/docs/balance/index.html index 1f2aa729c..74ec8f51c 100644 --- a/docs/balance/index.html +++ b/docs/balance/index.html @@ -4,7 +4,7 @@ Account balance | Starknet Devnet - + diff --git a/docs/blocks/index.html b/docs/blocks/index.html index 299c8f923..fa9ca9f52 100644 --- a/docs/blocks/index.html +++ b/docs/blocks/index.html @@ -4,7 +4,7 @@ Blocks | Starknet Devnet - + diff --git a/docs/category/running/index.html b/docs/category/running/index.html index 901c01cf5..c82a13bf5 100644 --- a/docs/category/running/index.html +++ b/docs/category/running/index.html @@ -4,7 +4,7 @@ Running | Starknet Devnet - + diff --git a/docs/dump-load-restart/index.html b/docs/dump-load-restart/index.html index c66944bf0..443539ebe 100644 --- a/docs/dump-load-restart/index.html +++ b/docs/dump-load-restart/index.html @@ -4,7 +4,7 @@ Dump, load, restart | Starknet Devnet - + diff --git a/docs/forking/index.html b/docs/forking/index.html index 70f3784ad..39f88f1fa 100644 --- a/docs/forking/index.html +++ b/docs/forking/index.html @@ -4,7 +4,7 @@ Forking | Starknet Devnet - + @@ -13,6 +13,8 @@
    $ starknet-devnet --fork-network <URL> [--fork-block <BLOCK_NUMBER>]

    The value passed to --fork-network should be the URL to a Starknet JSON-RPC API provider. Specifying a --fork-block is optional; it defaults to the "latest" block at the time of Devnet's start-up. All calls will first try Devnet's state and then fall back to the forking block.

    Account impersonation

    -

    Here you can read more about acting as an account deployed on the origin.

+

Here you can read more about acting as an account deployed on the origin.

+

Deploying an undeclared account

+

Here you can read about deploying an account not declared on Devnet.

\ No newline at end of file diff --git a/docs/historic-state/index.html b/docs/historic-state/index.html index 29ab4fe43..ca89fa105 100644 --- a/docs/historic-state/index.html +++ b/docs/historic-state/index.html @@ -4,7 +4,7 @@ Historic state support | Starknet Devnet - + diff --git a/docs/intro/index.html b/docs/intro/index.html index 914ee263a..33d48a38a 100644 --- a/docs/intro/index.html +++ b/docs/intro/index.html @@ -4,7 +4,7 @@ Intro | Starknet Devnet - + diff --git a/docs/lite/index.html b/docs/lite/index.html index 80ff4e5df..12a40cf41 100644 --- a/docs/lite/index.html +++ b/docs/lite/index.html @@ -4,7 +4,7 @@ Lite mode | Starknet Devnet - + diff --git a/docs/next/account-impersonation/index.html b/docs/next/account-impersonation/index.html index 571c174d2..45f3cdaea 100644 --- a/docs/next/account-impersonation/index.html +++ b/docs/next/account-impersonation/index.html @@ -3,12 +3,13 @@ -Account impersonation | Starknet Devnet - +Account impersonation | Starknet Devnet +
Version: Next

Account impersonation

+
info

This page is about account impersonation. To read about account class selection and deployment, click here.

Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in forking mode.

Caveat
  • Only INVOKE and DECLARE transactions are supported. DEPLOY_ACCOUNT transaction is not supported, but you can create an INVOKE transaction to UDC.
  • diff --git a/docs/next/api/index.html b/docs/next/api/index.html index 93d2539e6..936720a09 100644 --- a/docs/next/api/index.html +++ b/docs/next/api/index.html @@ -4,7 +4,7 @@ API | Starknet Devnet - + diff --git a/docs/next/balance/index.html b/docs/next/balance/index.html index 4e4013c81..7ab089a8f 100644 --- a/docs/next/balance/index.html +++ b/docs/next/balance/index.html @@ -4,7 +4,7 @@ Account balance | Starknet Devnet - + diff --git a/docs/next/blocks/index.html b/docs/next/blocks/index.html index ed7bee1c0..ecadee626 100644 --- a/docs/next/blocks/index.html +++ b/docs/next/blocks/index.html @@ -4,7 +4,7 @@ Blocks | Starknet Devnet - + diff --git a/docs/next/category/running/index.html b/docs/next/category/running/index.html index 5d578149f..07547c240 100644 --- a/docs/next/category/running/index.html +++ b/docs/next/category/running/index.html @@ -4,7 +4,7 @@ Running | Starknet Devnet - + diff --git a/docs/next/dump-load-restart/index.html b/docs/next/dump-load-restart/index.html index ba9b75d69..3d1cdb198 100644 --- a/docs/next/dump-load-restart/index.html +++ b/docs/next/dump-load-restart/index.html @@ -4,7 +4,7 @@ Dump, load, restart | Starknet Devnet - + diff --git a/docs/next/forking/index.html b/docs/next/forking/index.html index 741ead4d1..bb3b4196e 100644 --- a/docs/next/forking/index.html +++ b/docs/next/forking/index.html @@ -4,7 +4,7 @@ Forking | Starknet Devnet - + @@ -13,6 +13,8 @@
    $ starknet-devnet --fork-network <URL> [--fork-block <BLOCK_NUMBER>]

    The value passed to --fork-network should be the URL to a Starknet JSON-RPC API provider. Specifying a --fork-block is optional; it defaults to the "latest" block at the time of Devnet's start-up. All calls will first try Devnet's state and then fall back to the forking block.

    Account impersonation

    -

    Here you can read more about acting as an account deployed on the origin.

+

Here you can read more about acting as an account deployed on the origin.

+

Deploying an undeclared account

+

Here you can read about deploying an account not declared on Devnet.

\ No newline at end of file diff --git a/docs/next/historic-state/index.html b/docs/next/historic-state/index.html index 11e8c3924..ccf65b59d 100644 --- a/docs/next/historic-state/index.html +++ b/docs/next/historic-state/index.html @@ -4,7 +4,7 @@ Historic state support | Starknet Devnet - + diff --git a/docs/next/intro/index.html b/docs/next/intro/index.html index 0f079053d..78dc00331 100644 --- a/docs/next/intro/index.html +++ b/docs/next/intro/index.html @@ -4,7 +4,7 @@ Intro | Starknet Devnet - + diff --git a/docs/next/lite/index.html b/docs/next/lite/index.html index bff636ca9..b5b1cce68 100644 --- a/docs/next/lite/index.html +++ b/docs/next/lite/index.html @@ -4,7 +4,7 @@ Lite mode | Starknet Devnet - + diff --git a/docs/next/postman/index.html b/docs/next/postman/index.html index 4cbf9b9e8..e73065c55 100644 --- a/docs/next/postman/index.html +++ b/docs/next/postman/index.html @@ -4,7 +4,7 @@ L1-L2 interaction via Postman | Starknet Devnet - + diff --git a/docs/next/predeployed/index.html b/docs/next/predeployed/index.html index b9d8f3045..fbed9d605 100644 --- a/docs/next/predeployed/index.html +++ b/docs/next/predeployed/index.html @@ -4,7 +4,7 @@ Predeployed contracts | Starknet Devnet - + @@ -16,7 +16,9 @@

Acco
--account-class [cairo0 | cairo1]

Alternatively, provide a path to the Sierra artifact of your custom account using:

--account-class-custom <SIERRA_PATH>
+

Deploying an undeclared account

+

If you want to deploy an instance of an account contract class not predeclared on Devnet, you can use forking. Just fork an origin network which has the needed class already declared, e.g. the Sepolia testnet. Why? Because new versions of wallets like ArgentX and Braavos tend to be declared on testnet/mainnet soon after release.

How to get predeployment info?

-

The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a GET request to /predeployed_accounts of your Devnet.

+

The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a GET request to /predeployed_accounts of your Devnet.

\ No newline at end of file diff --git a/docs/next/running/cli/index.html b/docs/next/running/cli/index.html index 226ae8b0b..e0d73f34f 100644 --- a/docs/next/running/cli/index.html +++ b/docs/next/running/cli/index.html @@ -4,7 +4,7 @@ CLI options | Starknet Devnet - + diff --git a/docs/next/running/docker/index.html b/docs/next/running/docker/index.html index 4033a8b33..7350e2a92 100644 --- a/docs/next/running/docker/index.html +++ b/docs/next/running/docker/index.html @@ -4,7 +4,7 @@ Run with Docker | Starknet Devnet - + diff --git a/docs/next/running/install/index.html b/docs/next/running/install/index.html index 043755d97..dcff6da7e 100644 --- a/docs/next/running/install/index.html +++ b/docs/next/running/install/index.html @@ -4,7 +4,7 @@ Install and run | Starknet Devnet - + diff --git a/docs/next/server-config/index.html b/docs/next/server-config/index.html index 049c38f5a..67809f612 100644 --- a/docs/next/server-config/index.html +++ b/docs/next/server-config/index.html @@ -4,7 +4,7 @@ Server config | Starknet Devnet - + diff --git a/docs/next/starknet-time/index.html b/docs/next/starknet-time/index.html index 0f0c29577..189853cd4 100644 --- a/docs/next/starknet-time/index.html +++ b/docs/next/starknet-time/index.html @@ -4,7 +4,7 @@ Starknet time | Starknet Devnet - + diff --git a/docs/postman/index.html b/docs/postman/index.html index e4f24f6ac..7aed78732 100644 --- a/docs/postman/index.html +++ b/docs/postman/index.html @@ -4,7 +4,7 @@ L1-L2 interaction via Postman | Starknet Devnet - + diff --git a/docs/predeployed/index.html b/docs/predeployed/index.html index 4d7f59df8..5bb9cbb11 100644 --- a/docs/predeployed/index.html +++ b/docs/predeployed/index.html @@ -4,7 +4,7 @@ Predeployed contracts | Starknet Devnet - + @@ -16,7 +16,9 @@

Acco
--account-class [cairo0 | cairo1]

Alternatively, provide a path to the Sierra artifact of your custom account using:

--account-class-custom <SIERRA_PATH>
+

Deploying an undeclared account

+

If you want to deploy an instance of an account contract class not predeclared on Devnet, you can use forking. Just fork an origin network which has the needed class already declared, e.g. the Sepolia testnet. Why? Because new versions of wallets like ArgentX and Braavos tend to be declared on testnet/mainnet soon after release.

How to get predeployment info?

-

The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a GET request to /predeployed_accounts of your Devnet.

+

The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a GET request to /predeployed_accounts of your Devnet.

\ No newline at end of file diff --git a/docs/running/cli/index.html b/docs/running/cli/index.html index 6c030c737..e4fd1d46f 100644 --- a/docs/running/cli/index.html +++ b/docs/running/cli/index.html @@ -4,7 +4,7 @@ CLI options | Starknet Devnet - + diff --git a/docs/running/docker/index.html b/docs/running/docker/index.html index 0ea4adfbb..478e8ad30 100644 --- a/docs/running/docker/index.html +++ b/docs/running/docker/index.html @@ -4,7 +4,7 @@ Run with Docker | Starknet Devnet - + diff --git a/docs/running/install/index.html b/docs/running/install/index.html index 161c873c3..9ccf69f15 100644 --- a/docs/running/install/index.html +++ b/docs/running/install/index.html @@ -4,7 +4,7 @@ Install and run | Starknet Devnet - + diff --git a/docs/server-config/index.html b/docs/server-config/index.html index 4d6beb971..294cff86d 100644 --- a/docs/server-config/index.html +++ b/docs/server-config/index.html @@ -4,7 +4,7 @@ Server config | Starknet Devnet - + diff --git a/docs/starknet-time/index.html b/docs/starknet-time/index.html index 65d3e450a..f0c7085d0 100644 --- a/docs/starknet-time/index.html +++ b/docs/starknet-time/index.html @@ -4,7 +4,7 @@ Starknet time | Starknet Devnet - + diff --git a/index.html b/index.html index 012aac30e..f31e35c46 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Home | Starknet Devnet - + diff --git a/markdown-page/index.html b/markdown-page/index.html index 1ad936689..0728aa426 100644 --- a/markdown-page/index.html +++ b/markdown-page/index.html @@ -4,7 +4,7 @@ Markdown page example | Starknet Devnet - +