!! This plugin is not ready for 3rd party production use yet. If you want to use it you must really understand the code !! PRs to make it production ready and more eyes on this code are most welcome!
This is a plugin for pretix. This plugin supports both Ethereum and DAI.
It started with ligi suggesting pretix for Ethereum Magicians.
Then it was used for Ethereum Magicians in Paris (shout out to boris for making this possible) - but accepting ETH or DAI was a fully manual process there.
Afterwards boris put up some funds for a gitcoin bounty to make a plugin that automates this process. And nanexcool increased the funds and added the requirement for DAI.
The initial version was developed by vic-en but he vanished from the project after cashing in the bounty money and left the plugin in a non-working state.
Then the idea came up to use this plugin for DevCon5 and the plugin was forked to this repo and ligi, david sanders, piper meriam, rami, Pedro Gomes, and Jamie Pitts brought it to a state where it is usable for DevCon5 (still a lot of work to be done to make this a good plugin). Currently, it is semi-automatic. But it now has ERC-681 and Web3Modal support. If you want to dig a bit into the problems that emerged short before the launch you can have a look at this issue
For DEVcon6 the plugin was extended with some more features like Layer2 support by Rahul. Layer2 will play a significant role in Ethereum. Unfortunately DEVcon6 was delayed due to covid - but we where able to use and this way test via the LisCon ticket sale. As far as we know this was the first event ever offering a Layer2 payment option. In the process tooling like Web3Modal / Checkout that we depend on was improved.
confirm_payments
section below for details.local/pretix-eth-payment-plugin
.pip install -e .[dev]
within the pretix-eth-payment-plugin
repo
directory.make devmigrate
.make devserver
.admin@localhost
and password admin
to log in.{"ETH_RATE": 4000, "DAI_RATE": 1}
i.e. KEY
= <CRYPTO_SMBOL>_RATE
and VALUE
= value of 1 unit in your fiat currency e.g. USD, EUR etc. For USD, above example says 1 ETH = 4000$. If EUR was chosen, then this says 1 ETH = 4000EUR.
{
"L1_RPC_URL": "https://mainnet.infura.io/v3/somekeyhere",
"Rinkeby_RPC_URL": "...",
"RinkebyArbitrum_RPC_URL": "..."
}
i.e. KEY
= <Network ID>_RPC_URL
and VALUE
= RPC URL. Network IDs can be found in tokens.py
You can now play with the event by clicking on the "Go to Shop" button at the top left (next to the event name)
confirm_payments
commandThis plugin includes a django management command that can be used to automatically confirm orders from the Ethereum address associated with each order across all events. By default, this command will perform a dry run which only displays payment records that would be modified and why but without actually modifying them.
Here's an example invocation of this command:
python -mpretix confirm_payments \
--no-dry-run
Note that this doesn't require you to pass any event slug, since it runs for all events at once. It inspects the address that was associated with each order (at
the time the ticket was reserved) to determine if sufficient payments were made
for the order. It may check for an ethereum payment or some kind of token
payment depending on what was chosen during the checkout process. It checks using the RPC URLs that were configured in the admin settings while setting up the event. If no rpc urls were set, then the command gives yet another chance to type in a rpc url (like infura). The --no-dry-run
flag directs the command to
update order statuses based on the checks that are performed. Without this
flag, the command will only display how records would be modified.
For more details about the confirm_payments
command and its options, the
command may be invoked with --help
:
python -mpretix confirm_payments --help
Copyright 2019 Victor (https://github.com/vic-en)
Released under the terms of the Apache License 2.0