contracts

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 15 Imported by: 0

README

Accounts

This directory contains a number of experimental accounts and links related to them. In particular, you will find:

  • A link to the OZ v0.3.2 preset account you might not want to use
  • A link to the OZ v0.4.0b preset account you might not want to use
  • A link to the Argentlabs/Ledger/Catridge plugin account, you might not want to use either
  • The implementation of the YeaSayer plugin that always agree on the transactions and the implementation of the SessionKey plugin that comes with the plugin account
  • A very basic counter account for demonstration purposes
  • A simple OZ ERC-20 preset account that you probably can use

Building Accounts and Contracts

Since those contracts are being improved, we did not want to include them in this repository but link them. To help you, we provide a Makefile that shows how to build those contracts. You should:

  • install cairo v0.9.1 with Python 3.9 and run the following commands
# this command reset the OZ submodule to a version that was providing the v0
# account. It is using the cairo v0.9 syntax
make v0 -f MakefileV0
# compile the contracts
make -f MakefileV0
  • install cairo v0.10 with Python 3.9 and run the following commands
make latest
make

Explanation: Starknet v0.9 and v.10 contract bytecodes should be compatible. However, the v0 transaction implementations of protocol tend to be developed with Cairo v0.9 when v1 transaction implementations of protocol tend to be developed with Cairo v0.10. That is why we need the 2 versions for now.

Documentation

Index

Constants

View Source
const (
	PROVIDER_GATEWAY = "gateway"
	PROVIDER_RPCV01  = "rpcv01"
	ACCOUNT_VERSION0 = "v0"
	ACCOUNT_VERSION1 = "v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountManager

type AccountManager struct {
	AccountAddress   string `json:"accountAddress"`
	AccountClassHash string `json:"accountClassHash,omitempty"`

	PluginClassHash string `json:"pluginClassHash,omitempty"`
	PrivateKey      string `json:"privateKey"`
	ProxyClassHash  string `json:"proxyClassHash,omitempty"`
	PublicKey       string `json:"publicKey"`
	TransactionHash string `json:"transactionHash,omitempty"`
	Version         string `json:"accountVersion"`
	// contains filtered or unexported fields
}

func InstallAndWaitForAccountNoWallet deprecated

func InstallAndWaitForAccountNoWallet[V *rpcv01.Provider | *gateway.GatewayProvider](ctx context.Context, provider V, privateKey *big.Int, compiledContracts artifacts.CompiledContract) (*AccountManager, error)

InstallAndWaitForAccount installs an account with a DEPLOY command.

Deprecated: this function should be replaced by InstallAndWaitForAccount that will use the DEPLOY_ACCOUNT syscall.

func (*AccountManager) CallWithGateway

func (ap *AccountManager) CallWithGateway(call types.FunctionCall, provider *gateway.GatewayProvider) ([]string, error)

func (*AccountManager) ExecuteWithGateway

func (ap *AccountManager) ExecuteWithGateway(counterAddress, selector string, provider *gateway.GatewayProvider) (string, error)

func (*AccountManager) ExecuteWithRPCv01

func (ap *AccountManager) ExecuteWithRPCv01(counterAddress, selector string, provider *rpcv01.Provider) (string, error)

func (*AccountManager) ExecuteWithSessionKey

func (ap *AccountManager) ExecuteWithSessionKey(counterAddress, selector string, provider *rpcv01.Provider) (string, error)

func (*AccountManager) Read

func (ap *AccountManager) Read(filename string) error

func (*AccountManager) Write

func (ap *AccountManager) Write(filename string) error

type DeclareOutput

type DeclareOutput struct {
	// contains filtered or unexported fields
}

type DeployOutput

type DeployOutput struct {
	ContractAddress string
	ClassHash       string
	TransactionHash string
}

type GatewayProvider

type GatewayProvider gateway.GatewayProvider

type Provider

type Provider interface {
	// contains filtered or unexported methods
}

type RPCv01Provider

type RPCv01Provider rpcv01.Provider

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL