To begin using this project, run:
$ yarn install
You can also view more detailed instructions on starting this project under Stackup's readme. (Make sure to save the config.json file we have provided, however.)
If you would like to change the config file you can change:
ecoAddress: luke-goerli.eththe address the donations go tooffset: 0.001: change the fixed donation amountroundTo: 0.001: change the rounding number
in config.json to customize these parameters.
You can also run any of these commands with --help, they have similar options.
Usage: ERC-4337 SimpleAccount ecoTransfer [options]
Transfer ETH and offset equivalent environmental cost
Options:
-dr, --dryRun Builds the UserOperation without calling eth_sendUserOperation
-pm, --withPaymaster Use a paymaster for this transaction
-t, --to <address> The recipient address
-amt, --amount <eth> Amount in ETH to transfer
-h, --help display help for command
This function calculates the callGasLimit and maxFeePerGas for an ether transfer, and sends double the equivalent amount of ether to ecoAddress to offset the carbon cost of the transaction.
Example usage:
$ yarn run simpleAccount ecoTransfer --to 0xE188ae79149fb7441c854CbDb61ebb4be1a18a4e --amount 0.001
This function transfersa a fixed amount offset of eth to ecoAddress in order to offset the environmental cost of the transactions or donate to an arbitrary on-chain cause (e.g. water rights).
Example usage:
$ yarn run simpleAccount ecoTransferFixed --to 0xE188ae79149fb7441c854CbDb61ebb4be1a18a4e --amount 0.001
This function automatically rounds each transaction the user sends to the nearest roundTo eth, and sends it to ecoAddress to offset environmental costs or send donations.
Example usage:
$ yarn run simpleAccount roundTransfer --to 0xE188ae79149fb7441c854CbDb61ebb4be1a18a4e --amount 0.0003