This repository contains two example scripts to help you construct a cleos propose command containing an EVM transaction:
generateEVMTransaction, that serializes the EVM transaction data of a call to thesetLockDuration()function of theTelosEscrowEVM contractgeneratePermissions, that retreives the Telos BPs and adds them to a permissions array
This repository requires NodeJS 14+ as well as EOSIO's cleos & keosk
npm install
Sending transactions to EVM requires the use of the eosio.evm contract's raw(...) action.
This method takes in the serialized EVM Transaction data, the native account that will pay the RAM and the sender address which the transaction will be sent from on EVM.
In our case the native account will be prods.evm and the sender address will be the EVM address linked to that native account, which also owns the TelosEscrow contract and hence is the only one that can modify the settings.
The generateEVMTransaction script populates & serializes an EVM transaction and uses it to populate a native transaction with an action that calls eosio.evm raw(...) method. This example uses the setLockDuration function of the TelosEscrow EVM Contract with a parameter of 3600 seconds.
To use it run:
node generateEVMTransaction.js
It will generate an transaction.json file in the output folder
This script, taken from our Native to EVM Transaction repository can easily be adapted to call other methods of the contract such as setMaxDeposits or transferOwnership or even another contract entirely !
To send a multisig, we need to setup the list of signers' permissions. In this Telos Escrow case our signers are the current active BPs. The generateSignerList script saves those BPs permissions into a file.
To use it run:
node generatePermissions.js
It will generate a permissions.json file in the output folder
Run the following cleos command, replacing YOUR_NATIVE_ACCOUNT with your Telos native account name and PROPOSAL by your proposal's name.
cleos --url https://testnet.telos.net multisig propose_trx PROPOSAL ./output/permissions.json ./output/transaction.json YOUR_NATIVE_ACCOUNT
You could also use the EOSJS library to create the Multisig proposal directly from your script.