You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Select input type of ABI and bytecode.// It is also possible to input the entire abi and bytecode as a string type, but you can also enter a file path.// ABI type must be json and bytecode file must be compiled file on Remix IDE.// Constructor input argumentsvarargs []interface{}
owner:= []common.Address{
common.HexToAddress("0xC9F0A2b814d389088a508E31fBa483E8C4372CC2"),
common.HexToAddress("0x41776240700C033A75A2872EF0AD32b4911e13B1"),
common.HexToAddress("0xaaC4758A943B2692F2daE0DE8d402aD7045A8DfB"),
}
required:=big.NewInt(2)
args=append(args, owner)
args=append(args, required)
deploySolContractMsg:= types.DeploySolContractMsg{
//ABI: `{ ABI json string type }`ABIJsonFilePath: "./abi.json",
// Bytecode: "60806040523480156100......",BytecodeJsonFilePath: "./bytecode.json",
Args: args,
}
txbytes, err:=xplac.DeploySolidityContract(deploySolContractMsg).CreateAndSignTx()
res, err:=xplac.Broadcast(txbytes)
(Tx) Invoke(execute) solidity contract
// When invoked, the arguments to be entered into the solidity contract are listed as []interface{}.varargs []interface{}
args=append(a, big.NewInt(2))
// Need contract address and invoke function name.// Also, same as deployment, need ABI and bytecode.invokeSolContractMsg:= types.InvokeSolContractMsg{
ContractAddress: "0xBe0AE9A424771C0D68D942A04994a97f928b0821",
ContractFuncCallName: "store",
Args: args,
ABIJsonFilePath: "./abi.json",
BytecodeJsonFilePath: "./bytecode.json",
}
txbytes, err:=xplac.InvokeSolidityContract(invokeSolContractMsg).CreateAndSignTx()
res, err:=xplac.Broadcast(txbytes)
// Query account info of user account or contract// Response of query includes account address(Hex and Bech32), balances and etc. // Including Info list// - "account" : account address// - "bech32_account" : account address of Bech32// - "balance" : balances of the account (eth_getBalance)// - "nonce" : account nonce as sequence of tendermint based blockchain (eth_getTransactionCount)// - "storage" : the storage address for a given account (eth_getStorageAt)// - "code" : the contract code of the given account (eth_getCode)// - "pending_balance" : the axpla balance of the given account in the pending state (eth_getBalance of the pending state)// - "pending_nonce" : the account nonce of the given account in the pending state (eth_getTransactionCount of the pending state)// - "pending_storage" : the value of key in the contract storage of the given account in the pending state (eth_getStorageAt of the pending state)// - "pending_code" : the contract code of the given account in the pending state (eth_getCode of the pending state)// - "pending_transaction_count" : the total number of transactions in the pending state (eth_getBlockTransactionCountByNumber of the pending state)// so, the xpla.go would not support some RPC APIs as "eth_getBalance", "eth_getTransactionCount", "eth_getStorageAt" and "eth_getCode" because the function is AccountInfo includes these.accountInfoMsg:= types.AccountInfoMsg{
Account: "0xCa8582862B82867C4Bb9E926682dD75820dE6013",
}
res, err:=xplac.AccountInfo(accountInfoMsg).Query()