diff --git a/.gitignore b/.gitignore index b375da5d0..add318d06 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__/ node_modules/ artifacts/ .mypy_cache +pkg/chain/ethereum/gen/abi/**/*.abi # Visual Studio Code *.code-workspace diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..60d84fcb9 --- /dev/null +++ b/go.mod @@ -0,0 +1,9 @@ +module github.com/keep-network/tbtc + +go 1.13 + +require ( + github.com/ethereum/go-ethereum v1.9.10 + github.com/ipfs/go-log v1.0.4 + github.com/keep-network/keep-common v1.2.1-0.20201020114759-19c123cbd4f4 +) diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..e361e33fb --- /dev/null +++ b/go.sum @@ -0,0 +1,409 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= +github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= +github.com/Shopify/sarama v1.23.1/go.mod h1:XLH1GYJnLVE0XCr6KdJGVJRTwY30moWNJ4sERjXX6fs= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VictoriaMetrics/fastcache v1.5.3 h1:2odJnXLbFZcoV9KYtQ+7TH1UOq3dn3AssMgieaezkR4= +github.com/VictoriaMetrics/fastcache v1.5.3/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE= +github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= +github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/aristanetworks/fsnotify v1.4.2/go.mod h1:D/rtu7LpjYM8tRJphJ0hUBYpjai8SfX+aSNsWDTq/Ks= +github.com/aristanetworks/glog v0.0.0-20180419172825-c15b03b3054f/go.mod h1:KASm+qXFKs/xjSoWn30NrWBBvdTTQq+UjkhjEJHfSFA= +github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847 h1:rtI0fD4oG/8eVokGVPYJEW1F88p1ZNgXiEIs9thEE4A= +github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= +github.com/aristanetworks/goarista v0.0.0-20190924011532-60b7b74727fd h1:2gXWYquahfk3RfmyLuMk47NCaf+1FFQ95FNM+HZN3Oo= +github.com/aristanetworks/goarista v0.0.0-20190924011532-60b7b74727fd/go.mod h1:Z4RTxGAuYhPzcq8+EdRM+R8M48Ssle2TsWtwRKa+vns= +github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/2YanvOEnLMUgsFrxBROc= +github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= +github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= +github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= +github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= +github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c h1:JHHhtb9XWJrGNMcrVP6vyzO4dusgi/HnceHTgxSejUM= +github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= +github.com/elastic/gosigar v0.10.5 h1:GzPQ+78RaAb4J63unidA/JavQRKrB6s8IOzN6Ib59jo= +github.com/elastic/gosigar v0.10.5/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= +github.com/ethereum/go-ethereum v1.9.10 h1:jooX7tWcscpC7ytufk73t9JMCeJQ7aJF2YmZJQEuvFo= +github.com/ethereum/go-ethereum v1.9.10/go.mod h1:lXHkVo/MTvsEXfYsmNzelZ8R1e0DTvdk/wMZJIRpaRw= +github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc h1:jtW8jbpkO4YirRSyepBOH8E+2HEw6/hKkBvFPwhUN8c= +github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989 h1:giknQ4mEuDFmmHSrGcbargOuLHQGtywqo4mheITex54= +github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277 h1:E0whKxgp2ojts0FDgUA8dl62bmH0LxKanMoBr6MDTDM= +github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huin/goupnp v0.0.0-20161224104101-679507af18f3/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= +github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= +github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= +github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883 h1:FSeK4fZCo8u40n2JMnyAsd6x7+SbvoOMHvQOU/n10P4= +github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= +github.com/influxdata/influxdb1-client v0.0.0-20190809212627-fc22c7df067e/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/ipfs/go-log v0.0.1 h1:9XTUN/rW64BCG1YhPK9Hoy3q8nr4gOmHHBpgFdfw6Lc= +github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= +github.com/ipfs/go-log v1.0.4 h1:6nLQdX4W8P9yZZFH7mO+X/PzjN8Laozm/lMJ6esdgzY= +github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= +github.com/ipfs/go-log/v2 v2.0.5 h1:fL4YI+1g5V/b1Yxr1qAiXTMg1H8z9vx/VmJxBuQMHvU= +github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 h1:6OvNmYgJyexcZ3pYbTI9jWx5tHo1Dee/tWbLMfPe2TA= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9 h1:ZHuwnjpP8LsVsUYqTqeVAI+GfDfJ6UNPrExZF+vX/DQ= +github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/keep-network/keep-common v1.2.1-0.20201020114759-19c123cbd4f4 h1:CivupPSFswHACua5xZGKdeYxsCQ2cmRomTIBh8kfk70= +github.com/keep-network/keep-common v1.2.1-0.20201020114759-19c123cbd4f4/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/reedsolomon v1.9.2/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/mattn/go-colorable v0.1.0 h1:v2XXALHHh6zHfYTJ+cSkwtyffnaOyR1MXaA91mTrb8o= +github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035 h1:USWjF42jDCSEeikX/G1g40ZWnsPXN5WkZ4jMHZWyBK4= +github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= +github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c h1:1RHs3tNxjXGHeul8z2t6H2N2TlAqpKe5yryJztRx4Jk= +github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.2 h1:sq53g+DWf0J6/ceFUHpQ0nAEb6WgM++fq16MZ91cS6o= +github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= +github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 h1:goeTyGkArOZIVOMA0dQbyuPWGNQJZGPwPu/QS9GlpnA= +github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= +github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= +github.com/pierrec/lz4 v0.0.0-20190327172049-315a67e90e41/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150 h1:ZeU+auZj1iNzN8iVhff6M38Mfu73FQiJve/GEXYJBjE= +github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= +github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= +github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= +github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= +github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= +github.com/robertkrimen/otto v0.0.0-20170205013659-6a77b7cbc37d/go.mod h1:xvqspoSXJTIpemEonrMDFq6XzwHYYgToXWj5eRX1OtY= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00 h1:8DPul/X0IT/1TNMIxoKLwdemEOBBHDC/K4EB16Cw5WE= +github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521 h1:3hxavr+IHMsQBrYUPQM5v0CgENFktkkbg1sfpgM3h20= +github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/status-im/keycard-go v0.0.0-20191119114148-6dd40a46baa0 h1:5UdlDkkBoPrJfh7zkfoR3X5utJhNs/MCQysK3x0ycgg= +github.com/status-im/keycard-go v0.0.0-20191119114148-6dd40a46baa0/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 h1:gIlAHnH1vJb5vwEjIp5kBj/eu99p/bl0Ay2goiPe5xE= +github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= +github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 h1:njlZPzLwU639dk2kqnCPPv+wNjq7Xb6EfUxe/oX0/NM= +github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs= +github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= +github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU= +github.com/templexxx/xor v0.0.0-20181023030647-4e92f724b73b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= +github.com/tjfoc/gmsm v1.0.1/go.mod h1:XxO4hdhhrzAd+G4CjDqaOkd0hUzmtPR/d3EiBBMn/wc= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/tyler-smith/go-bip39 v1.0.2 h1:+t3w+KwLXO6154GNJY+qUtIxLTmFjfUmpguQT1OlOT8= +github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc h1:9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo= +github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= +github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 h1:1cngl9mPEoITZG8s8cVcUy5CeIBYhEESkOB7m6Gmkrk= +github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +github.com/xtaci/kcp-go v5.4.5+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45a+AZwO7eyRCmEIbtvE= +github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62kEgmN++bm9BVICuT/e8yiLI2KFobd/TRFsE= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= +go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190926114937-fa1a29108794 h1:4Yo9XtTfxfBCecLiBW8TYsFIdN7TkDhjGLWetFo4JSo= +golang.org/x/crypto v0.0.0-20190926114937-fa1a29108794/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 h1:qPnAdmjNA41t3QBTx2mFGf/SD1IoslhYu7AmdsVzCcs= +golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 h1:rOhMmluY6kLMhdnrivzec6lLgaVbMHMn2ISQXJeJ5EM= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190912185636-87d9f09c5d89/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190925230517-ea99b82c7b93 h1:Ejrp5SZ9rwPbsIk7rakjfOLd9H06/JNTx+5mO81yBz4= +golang.org/x/tools v0.0.0-20190925230517-ea99b82c7b93/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= +gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= +gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= +gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= +gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190213234257-ec84240a7772/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff h1:uuol9OUzSvZntY1v963NAbVd7A+PHLMz1FlCe3Lorcs= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= +gopkg.in/redis.v4 v4.2.4/go.mod h1:8KREHdypkCEojGKQcjMqAODMICIVwZAONWq8RowTITA= +gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/pkg/chain/ethereum/gen/Makefile b/pkg/chain/ethereum/gen/Makefile new file mode 100644 index 000000000..db1cded2a --- /dev/null +++ b/pkg/chain/ethereum/gen/Makefile @@ -0,0 +1,54 @@ +# Environment `SOLIDITY_DIR` provides the solidity directory as a +# potentially-relative path, which we resolve. However, because +# Solidity files are grouped into separate subdirectories, specific +# files must be provided explicitly via `SOLIDITY_FILES` variable +# to handle them in a correct way. +solidity_dir=$(realpath ${SOLIDITY_DIR}) +solidity_files := $(foreach file,${SOLIDITY_FILES},$(file)) + +# Solidity filenames without .sol with subdirectories prefixes. +contract_stems := $(basename $(solidity_files)) +# Go abigen bindings in abi/ subdirectory with .go suffix, alongside solc ABI +# files with .abi suffix. +abi_files := $(addprefix abi/,$(addsuffix .abi,$(contract_stems))) +abigen_files := $(addprefix abi/,$(addsuffix .go,$(contract_stems))) +contract_files := $(addprefix contract/,$(addsuffix .go,$(contract_stems))) + +all: gen_contract_go gen_abi_go + +clean: + rm -r abi/* + rm -r contract/* + mkdir tmp && mv cmd/cmd*.go tmp + rm -r cmd/* + mv tmp/* cmd && rm -r tmp + +gen_abi_go: $(abigen_files) + +gen_contract_go: $(contract_files) + +abi/%.abi: ${solidity_dir}/contracts/%.sol + $(eval output=$(dir $@)) + mkdir -p $(output) + solc openzeppelin-solidity/=${solidity_dir}/node_modules/openzeppelin-solidity/ \ + @summa-tx/bitcoin-spv-sol/=${solidity_dir}/node_modules/@summa-tx/bitcoin-spv-sol/ \ + @keep-network/keep-ecdsa/=${solidity_dir}/node_modules/@keep-network/keep-ecdsa/ \ + @summa-tx/relay-sol=${solidity_dir}/node_modules/@summa-tx/relay-sol/ \ + --allow-paths ${solidity_dir} \ + --overwrite \ + --abi \ + -o $(output) $< + +abi/%.go: abi/%.abi + $(eval type=$(notdir $*)) + go run github.com/ethereum/go-ethereum/cmd/abigen --abi $< --pkg abi --type $(type) --out $@ + +contract/deposit/Deposit.go cmd/deposit/Deposit.go: abi/deposit/Deposit.abi abi/deposit/Deposit.go *.go + go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/Deposit.go + +contract/system/TBTCSystem.go cmd/system/TBTCSystem.go: abi/system/TBTCSystem.abi abi/system/TBTCSystem.go *.go + go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/TBTCSystem.go + + + + diff --git a/pkg/chain/ethereum/gen/abi/deposit/Deposit.go b/pkg/chain/ethereum/gen/abi/deposit/Deposit.go new file mode 100644 index 000000000..f5c411ad9 --- /dev/null +++ b/pkg/chain/ethereum/gen/abi/deposit/Deposit.go @@ -0,0 +1,1091 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abi + +import ( + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// DepositABI is the input ABI used to generate the binding from. +const DepositABI = "[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"constant\":true,\"inputs\":[],\"name\":\"auctionValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"collateralizationPercentage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentState\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"exitCourtesyCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fundingInfo\",\"outputs\":[{\"internalType\":\"bytes8\",\"name\":\"utxoValueBytes\",\"type\":\"bytes8\"},{\"internalType\":\"uint256\",\"name\":\"fundedAt\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"utxoOutpoint\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_redeemer\",\"type\":\"address\"}],\"name\":\"getOwnerRedemptionTbtcRequirement\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_redeemer\",\"type\":\"address\"}],\"name\":\"getRedemptionTbtcRequirement\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"inActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"_previousOutputValueBytes\",\"type\":\"bytes8\"},{\"internalType\":\"bytes8\",\"name\":\"_newOutputValueBytes\",\"type\":\"bytes8\"}],\"name\":\"increaseRedemptionFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"initialCollateralizedPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contractITBTCSystem\",\"name\":\"_tbtcSystem\",\"type\":\"address\"},{\"internalType\":\"contractTBTCToken\",\"name\":\"_tbtcToken\",\"type\":\"address\"},{\"internalType\":\"contractIERC721\",\"name\":\"_tbtcDepositToken\",\"type\":\"address\"},{\"internalType\":\"contractFeeRebateToken\",\"name\":\"_feeRebateToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vendingMachineAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_lotSizeSatoshis\",\"type\":\"uint64\"}],\"name\":\"initializeDeposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"keepAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"lotSizeSatoshis\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"lotSizeTbtc\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyCourtesyCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyCourtesyCallExpired\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyFundingTimedOut\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyRedemptionProofTimedOut\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyRedemptionSignatureTimedOut\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifySignerSetupFailed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyUndercollateralizedLiquidation\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_txVersion\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"_txInputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_txOutputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"_txLocktime\",\"type\":\"bytes4\"},{\"internalType\":\"uint8\",\"name\":\"_fundingOutputIndex\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"_merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_bitcoinHeaders\",\"type\":\"bytes\"}],\"name\":\"provideBTCFundingProof\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"_v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_signedDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_preimage\",\"type\":\"bytes\"}],\"name\":\"provideECDSAFraudProof\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"_v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_signedDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_preimage\",\"type\":\"bytes\"}],\"name\":\"provideFundingECDSAFraudProof\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_txVersion\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"_txInputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_txOutputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"_txLocktime\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"_merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_bitcoinHeaders\",\"type\":\"bytes\"}],\"name\":\"provideRedemptionProof\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"_v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"}],\"name\":\"provideRedemptionSignature\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"purchaseSignerBondsAtAuction\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"remainingTerm\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"requestFunderAbort\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"_outputValueBytes\",\"type\":\"bytes8\"},{\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"}],\"name\":\"requestRedemption\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"retrieveSignerPubkey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"severelyUndercollateralizedThresholdPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"signerFeeTbtc\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"_outputValueBytes\",\"type\":\"bytes8\"},{\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"internalType\":\"addresspayable\",\"name\":\"_finalRecipient\",\"type\":\"address\"}],\"name\":\"transferAndRequestRedemption\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"undercollateralizedThresholdPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"utxoValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"withdrawFunds\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"withdrawableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" + +// Deposit is an auto generated Go binding around an Ethereum contract. +type Deposit struct { + DepositCaller // Read-only binding to the contract + DepositTransactor // Write-only binding to the contract + DepositFilterer // Log filterer for contract events +} + +// DepositCaller is an auto generated read-only Go binding around an Ethereum contract. +type DepositCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DepositTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DepositTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DepositFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DepositFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DepositSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DepositSession struct { + Contract *Deposit // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DepositCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DepositCallerSession struct { + Contract *DepositCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DepositTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DepositTransactorSession struct { + Contract *DepositTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DepositRaw is an auto generated low-level Go binding around an Ethereum contract. +type DepositRaw struct { + Contract *Deposit // Generic contract binding to access the raw methods on +} + +// DepositCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DepositCallerRaw struct { + Contract *DepositCaller // Generic read-only contract binding to access the raw methods on +} + +// DepositTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DepositTransactorRaw struct { + Contract *DepositTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDeposit creates a new instance of Deposit, bound to a specific deployed contract. +func NewDeposit(address common.Address, backend bind.ContractBackend) (*Deposit, error) { + contract, err := bindDeposit(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Deposit{DepositCaller: DepositCaller{contract: contract}, DepositTransactor: DepositTransactor{contract: contract}, DepositFilterer: DepositFilterer{contract: contract}}, nil +} + +// NewDepositCaller creates a new read-only instance of Deposit, bound to a specific deployed contract. +func NewDepositCaller(address common.Address, caller bind.ContractCaller) (*DepositCaller, error) { + contract, err := bindDeposit(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DepositCaller{contract: contract}, nil +} + +// NewDepositTransactor creates a new write-only instance of Deposit, bound to a specific deployed contract. +func NewDepositTransactor(address common.Address, transactor bind.ContractTransactor) (*DepositTransactor, error) { + contract, err := bindDeposit(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DepositTransactor{contract: contract}, nil +} + +// NewDepositFilterer creates a new log filterer instance of Deposit, bound to a specific deployed contract. +func NewDepositFilterer(address common.Address, filterer bind.ContractFilterer) (*DepositFilterer, error) { + contract, err := bindDeposit(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DepositFilterer{contract: contract}, nil +} + +// bindDeposit binds a generic wrapper to an already deployed contract. +func bindDeposit(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(DepositABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Deposit *DepositRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Deposit.Contract.DepositCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Deposit *DepositRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.Contract.DepositTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Deposit *DepositRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Deposit.Contract.DepositTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Deposit *DepositCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Deposit.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Deposit *DepositTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Deposit *DepositTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Deposit.Contract.contract.Transact(opts, method, params...) +} + +// AuctionValue is a free data retrieval call binding the contract method 0x13f654df. +// +// Solidity: function auctionValue() constant returns(uint256) +func (_Deposit *DepositCaller) AuctionValue(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "auctionValue") + return *ret0, err +} + +// AuctionValue is a free data retrieval call binding the contract method 0x13f654df. +// +// Solidity: function auctionValue() constant returns(uint256) +func (_Deposit *DepositSession) AuctionValue() (*big.Int, error) { + return _Deposit.Contract.AuctionValue(&_Deposit.CallOpts) +} + +// AuctionValue is a free data retrieval call binding the contract method 0x13f654df. +// +// Solidity: function auctionValue() constant returns(uint256) +func (_Deposit *DepositCallerSession) AuctionValue() (*big.Int, error) { + return _Deposit.Contract.AuctionValue(&_Deposit.CallOpts) +} + +// CollateralizationPercentage is a free data retrieval call binding the contract method 0x6e4668be. +// +// Solidity: function collateralizationPercentage() constant returns(uint256) +func (_Deposit *DepositCaller) CollateralizationPercentage(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "collateralizationPercentage") + return *ret0, err +} + +// CollateralizationPercentage is a free data retrieval call binding the contract method 0x6e4668be. +// +// Solidity: function collateralizationPercentage() constant returns(uint256) +func (_Deposit *DepositSession) CollateralizationPercentage() (*big.Int, error) { + return _Deposit.Contract.CollateralizationPercentage(&_Deposit.CallOpts) +} + +// CollateralizationPercentage is a free data retrieval call binding the contract method 0x6e4668be. +// +// Solidity: function collateralizationPercentage() constant returns(uint256) +func (_Deposit *DepositCallerSession) CollateralizationPercentage() (*big.Int, error) { + return _Deposit.Contract.CollateralizationPercentage(&_Deposit.CallOpts) +} + +// CurrentState is a free data retrieval call binding the contract method 0x0c3f6acf. +// +// Solidity: function currentState() constant returns(uint256) +func (_Deposit *DepositCaller) CurrentState(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "currentState") + return *ret0, err +} + +// CurrentState is a free data retrieval call binding the contract method 0x0c3f6acf. +// +// Solidity: function currentState() constant returns(uint256) +func (_Deposit *DepositSession) CurrentState() (*big.Int, error) { + return _Deposit.Contract.CurrentState(&_Deposit.CallOpts) +} + +// CurrentState is a free data retrieval call binding the contract method 0x0c3f6acf. +// +// Solidity: function currentState() constant returns(uint256) +func (_Deposit *DepositCallerSession) CurrentState() (*big.Int, error) { + return _Deposit.Contract.CurrentState(&_Deposit.CallOpts) +} + +// FundingInfo is a free data retrieval call binding the contract method 0xdba49153. +// +// Solidity: function fundingInfo() constant returns(bytes8 utxoValueBytes, uint256 fundedAt, bytes utxoOutpoint) +func (_Deposit *DepositCaller) FundingInfo(opts *bind.CallOpts) (struct { + UtxoValueBytes [8]byte + FundedAt *big.Int + UtxoOutpoint []byte +}, error) { + ret := new(struct { + UtxoValueBytes [8]byte + FundedAt *big.Int + UtxoOutpoint []byte + }) + out := ret + err := _Deposit.contract.Call(opts, out, "fundingInfo") + return *ret, err +} + +// FundingInfo is a free data retrieval call binding the contract method 0xdba49153. +// +// Solidity: function fundingInfo() constant returns(bytes8 utxoValueBytes, uint256 fundedAt, bytes utxoOutpoint) +func (_Deposit *DepositSession) FundingInfo() (struct { + UtxoValueBytes [8]byte + FundedAt *big.Int + UtxoOutpoint []byte +}, error) { + return _Deposit.Contract.FundingInfo(&_Deposit.CallOpts) +} + +// FundingInfo is a free data retrieval call binding the contract method 0xdba49153. +// +// Solidity: function fundingInfo() constant returns(bytes8 utxoValueBytes, uint256 fundedAt, bytes utxoOutpoint) +func (_Deposit *DepositCallerSession) FundingInfo() (struct { + UtxoValueBytes [8]byte + FundedAt *big.Int + UtxoOutpoint []byte +}, error) { + return _Deposit.Contract.FundingInfo(&_Deposit.CallOpts) +} + +// GetOwnerRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd8d02330. +// +// Solidity: function getOwnerRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositCaller) GetOwnerRedemptionTbtcRequirement(opts *bind.CallOpts, _redeemer common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "getOwnerRedemptionTbtcRequirement", _redeemer) + return *ret0, err +} + +// GetOwnerRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd8d02330. +// +// Solidity: function getOwnerRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositSession) GetOwnerRedemptionTbtcRequirement(_redeemer common.Address) (*big.Int, error) { + return _Deposit.Contract.GetOwnerRedemptionTbtcRequirement(&_Deposit.CallOpts, _redeemer) +} + +// GetOwnerRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd8d02330. +// +// Solidity: function getOwnerRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositCallerSession) GetOwnerRedemptionTbtcRequirement(_redeemer common.Address) (*big.Int, error) { + return _Deposit.Contract.GetOwnerRedemptionTbtcRequirement(&_Deposit.CallOpts, _redeemer) +} + +// GetRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd02fd958. +// +// Solidity: function getRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositCaller) GetRedemptionTbtcRequirement(opts *bind.CallOpts, _redeemer common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "getRedemptionTbtcRequirement", _redeemer) + return *ret0, err +} + +// GetRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd02fd958. +// +// Solidity: function getRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositSession) GetRedemptionTbtcRequirement(_redeemer common.Address) (*big.Int, error) { + return _Deposit.Contract.GetRedemptionTbtcRequirement(&_Deposit.CallOpts, _redeemer) +} + +// GetRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd02fd958. +// +// Solidity: function getRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositCallerSession) GetRedemptionTbtcRequirement(_redeemer common.Address) (*big.Int, error) { + return _Deposit.Contract.GetRedemptionTbtcRequirement(&_Deposit.CallOpts, _redeemer) +} + +// InActive is a free data retrieval call binding the contract method 0xf97a02fa. +// +// Solidity: function inActive() constant returns(bool) +func (_Deposit *DepositCaller) InActive(opts *bind.CallOpts) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "inActive") + return *ret0, err +} + +// InActive is a free data retrieval call binding the contract method 0xf97a02fa. +// +// Solidity: function inActive() constant returns(bool) +func (_Deposit *DepositSession) InActive() (bool, error) { + return _Deposit.Contract.InActive(&_Deposit.CallOpts) +} + +// InActive is a free data retrieval call binding the contract method 0xf97a02fa. +// +// Solidity: function inActive() constant returns(bool) +func (_Deposit *DepositCallerSession) InActive() (bool, error) { + return _Deposit.Contract.InActive(&_Deposit.CallOpts) +} + +// InitialCollateralizedPercent is a free data retrieval call binding the contract method 0x76ef5510. +// +// Solidity: function initialCollateralizedPercent() constant returns(uint16) +func (_Deposit *DepositCaller) InitialCollateralizedPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "initialCollateralizedPercent") + return *ret0, err +} + +// InitialCollateralizedPercent is a free data retrieval call binding the contract method 0x76ef5510. +// +// Solidity: function initialCollateralizedPercent() constant returns(uint16) +func (_Deposit *DepositSession) InitialCollateralizedPercent() (uint16, error) { + return _Deposit.Contract.InitialCollateralizedPercent(&_Deposit.CallOpts) +} + +// InitialCollateralizedPercent is a free data retrieval call binding the contract method 0x76ef5510. +// +// Solidity: function initialCollateralizedPercent() constant returns(uint16) +func (_Deposit *DepositCallerSession) InitialCollateralizedPercent() (uint16, error) { + return _Deposit.Contract.InitialCollateralizedPercent(&_Deposit.CallOpts) +} + +// KeepAddress is a free data retrieval call binding the contract method 0x6c3b0114. +// +// Solidity: function keepAddress() constant returns(address) +func (_Deposit *DepositCaller) KeepAddress(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "keepAddress") + return *ret0, err +} + +// KeepAddress is a free data retrieval call binding the contract method 0x6c3b0114. +// +// Solidity: function keepAddress() constant returns(address) +func (_Deposit *DepositSession) KeepAddress() (common.Address, error) { + return _Deposit.Contract.KeepAddress(&_Deposit.CallOpts) +} + +// KeepAddress is a free data retrieval call binding the contract method 0x6c3b0114. +// +// Solidity: function keepAddress() constant returns(address) +func (_Deposit *DepositCallerSession) KeepAddress() (common.Address, error) { + return _Deposit.Contract.KeepAddress(&_Deposit.CallOpts) +} + +// LotSizeSatoshis is a free data retrieval call binding the contract method 0x90a2f687. +// +// Solidity: function lotSizeSatoshis() constant returns(uint64) +func (_Deposit *DepositCaller) LotSizeSatoshis(opts *bind.CallOpts) (uint64, error) { + var ( + ret0 = new(uint64) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "lotSizeSatoshis") + return *ret0, err +} + +// LotSizeSatoshis is a free data retrieval call binding the contract method 0x90a2f687. +// +// Solidity: function lotSizeSatoshis() constant returns(uint64) +func (_Deposit *DepositSession) LotSizeSatoshis() (uint64, error) { + return _Deposit.Contract.LotSizeSatoshis(&_Deposit.CallOpts) +} + +// LotSizeSatoshis is a free data retrieval call binding the contract method 0x90a2f687. +// +// Solidity: function lotSizeSatoshis() constant returns(uint64) +func (_Deposit *DepositCallerSession) LotSizeSatoshis() (uint64, error) { + return _Deposit.Contract.LotSizeSatoshis(&_Deposit.CallOpts) +} + +// LotSizeTbtc is a free data retrieval call binding the contract method 0x946fbf4c. +// +// Solidity: function lotSizeTbtc() constant returns(uint256) +func (_Deposit *DepositCaller) LotSizeTbtc(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "lotSizeTbtc") + return *ret0, err +} + +// LotSizeTbtc is a free data retrieval call binding the contract method 0x946fbf4c. +// +// Solidity: function lotSizeTbtc() constant returns(uint256) +func (_Deposit *DepositSession) LotSizeTbtc() (*big.Int, error) { + return _Deposit.Contract.LotSizeTbtc(&_Deposit.CallOpts) +} + +// LotSizeTbtc is a free data retrieval call binding the contract method 0x946fbf4c. +// +// Solidity: function lotSizeTbtc() constant returns(uint256) +func (_Deposit *DepositCallerSession) LotSizeTbtc() (*big.Int, error) { + return _Deposit.Contract.LotSizeTbtc(&_Deposit.CallOpts) +} + +// RemainingTerm is a free data retrieval call binding the contract method 0x35bc0ebe. +// +// Solidity: function remainingTerm() constant returns(uint256) +func (_Deposit *DepositCaller) RemainingTerm(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "remainingTerm") + return *ret0, err +} + +// RemainingTerm is a free data retrieval call binding the contract method 0x35bc0ebe. +// +// Solidity: function remainingTerm() constant returns(uint256) +func (_Deposit *DepositSession) RemainingTerm() (*big.Int, error) { + return _Deposit.Contract.RemainingTerm(&_Deposit.CallOpts) +} + +// RemainingTerm is a free data retrieval call binding the contract method 0x35bc0ebe. +// +// Solidity: function remainingTerm() constant returns(uint256) +func (_Deposit *DepositCallerSession) RemainingTerm() (*big.Int, error) { + return _Deposit.Contract.RemainingTerm(&_Deposit.CallOpts) +} + +// SeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x0d5889f4. +// +// Solidity: function severelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositCaller) SeverelyUndercollateralizedThresholdPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "severelyUndercollateralizedThresholdPercent") + return *ret0, err +} + +// SeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x0d5889f4. +// +// Solidity: function severelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositSession) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + return _Deposit.Contract.SeverelyUndercollateralizedThresholdPercent(&_Deposit.CallOpts) +} + +// SeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x0d5889f4. +// +// Solidity: function severelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositCallerSession) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + return _Deposit.Contract.SeverelyUndercollateralizedThresholdPercent(&_Deposit.CallOpts) +} + +// SignerFeeTbtc is a free data retrieval call binding the contract method 0x058d3703. +// +// Solidity: function signerFeeTbtc() constant returns(uint256) +func (_Deposit *DepositCaller) SignerFeeTbtc(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "signerFeeTbtc") + return *ret0, err +} + +// SignerFeeTbtc is a free data retrieval call binding the contract method 0x058d3703. +// +// Solidity: function signerFeeTbtc() constant returns(uint256) +func (_Deposit *DepositSession) SignerFeeTbtc() (*big.Int, error) { + return _Deposit.Contract.SignerFeeTbtc(&_Deposit.CallOpts) +} + +// SignerFeeTbtc is a free data retrieval call binding the contract method 0x058d3703. +// +// Solidity: function signerFeeTbtc() constant returns(uint256) +func (_Deposit *DepositCallerSession) SignerFeeTbtc() (*big.Int, error) { + return _Deposit.Contract.SignerFeeTbtc(&_Deposit.CallOpts) +} + +// UndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x85df153d. +// +// Solidity: function undercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositCaller) UndercollateralizedThresholdPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "undercollateralizedThresholdPercent") + return *ret0, err +} + +// UndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x85df153d. +// +// Solidity: function undercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositSession) UndercollateralizedThresholdPercent() (uint16, error) { + return _Deposit.Contract.UndercollateralizedThresholdPercent(&_Deposit.CallOpts) +} + +// UndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x85df153d. +// +// Solidity: function undercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositCallerSession) UndercollateralizedThresholdPercent() (uint16, error) { + return _Deposit.Contract.UndercollateralizedThresholdPercent(&_Deposit.CallOpts) +} + +// UtxoValue is a free data retrieval call binding the contract method 0x87a90d80. +// +// Solidity: function utxoValue() constant returns(uint256) +func (_Deposit *DepositCaller) UtxoValue(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "utxoValue") + return *ret0, err +} + +// UtxoValue is a free data retrieval call binding the contract method 0x87a90d80. +// +// Solidity: function utxoValue() constant returns(uint256) +func (_Deposit *DepositSession) UtxoValue() (*big.Int, error) { + return _Deposit.Contract.UtxoValue(&_Deposit.CallOpts) +} + +// UtxoValue is a free data retrieval call binding the contract method 0x87a90d80. +// +// Solidity: function utxoValue() constant returns(uint256) +func (_Deposit *DepositCallerSession) UtxoValue() (*big.Int, error) { + return _Deposit.Contract.UtxoValue(&_Deposit.CallOpts) +} + +// WithdrawableAmount is a free data retrieval call binding the contract method 0x951303f5. +// +// Solidity: function withdrawableAmount() constant returns(uint256) +func (_Deposit *DepositCaller) WithdrawableAmount(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "withdrawableAmount") + return *ret0, err +} + +// WithdrawableAmount is a free data retrieval call binding the contract method 0x951303f5. +// +// Solidity: function withdrawableAmount() constant returns(uint256) +func (_Deposit *DepositSession) WithdrawableAmount() (*big.Int, error) { + return _Deposit.Contract.WithdrawableAmount(&_Deposit.CallOpts) +} + +// WithdrawableAmount is a free data retrieval call binding the contract method 0x951303f5. +// +// Solidity: function withdrawableAmount() constant returns(uint256) +func (_Deposit *DepositCallerSession) WithdrawableAmount() (*big.Int, error) { + return _Deposit.Contract.WithdrawableAmount(&_Deposit.CallOpts) +} + +// ExitCourtesyCall is a paid mutator transaction binding the contract method 0x287b32e5. +// +// Solidity: function exitCourtesyCall() returns() +func (_Deposit *DepositTransactor) ExitCourtesyCall(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "exitCourtesyCall") +} + +// ExitCourtesyCall is a paid mutator transaction binding the contract method 0x287b32e5. +// +// Solidity: function exitCourtesyCall() returns() +func (_Deposit *DepositSession) ExitCourtesyCall() (*types.Transaction, error) { + return _Deposit.Contract.ExitCourtesyCall(&_Deposit.TransactOpts) +} + +// ExitCourtesyCall is a paid mutator transaction binding the contract method 0x287b32e5. +// +// Solidity: function exitCourtesyCall() returns() +func (_Deposit *DepositTransactorSession) ExitCourtesyCall() (*types.Transaction, error) { + return _Deposit.Contract.ExitCourtesyCall(&_Deposit.TransactOpts) +} + +// IncreaseRedemptionFee is a paid mutator transaction binding the contract method 0x9894d734. +// +// Solidity: function increaseRedemptionFee(bytes8 _previousOutputValueBytes, bytes8 _newOutputValueBytes) returns() +func (_Deposit *DepositTransactor) IncreaseRedemptionFee(opts *bind.TransactOpts, _previousOutputValueBytes [8]byte, _newOutputValueBytes [8]byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "increaseRedemptionFee", _previousOutputValueBytes, _newOutputValueBytes) +} + +// IncreaseRedemptionFee is a paid mutator transaction binding the contract method 0x9894d734. +// +// Solidity: function increaseRedemptionFee(bytes8 _previousOutputValueBytes, bytes8 _newOutputValueBytes) returns() +func (_Deposit *DepositSession) IncreaseRedemptionFee(_previousOutputValueBytes [8]byte, _newOutputValueBytes [8]byte) (*types.Transaction, error) { + return _Deposit.Contract.IncreaseRedemptionFee(&_Deposit.TransactOpts, _previousOutputValueBytes, _newOutputValueBytes) +} + +// IncreaseRedemptionFee is a paid mutator transaction binding the contract method 0x9894d734. +// +// Solidity: function increaseRedemptionFee(bytes8 _previousOutputValueBytes, bytes8 _newOutputValueBytes) returns() +func (_Deposit *DepositTransactorSession) IncreaseRedemptionFee(_previousOutputValueBytes [8]byte, _newOutputValueBytes [8]byte) (*types.Transaction, error) { + return _Deposit.Contract.IncreaseRedemptionFee(&_Deposit.TransactOpts, _previousOutputValueBytes, _newOutputValueBytes) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _factory) returns() +func (_Deposit *DepositTransactor) Initialize(opts *bind.TransactOpts, _factory common.Address) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "initialize", _factory) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _factory) returns() +func (_Deposit *DepositSession) Initialize(_factory common.Address) (*types.Transaction, error) { + return _Deposit.Contract.Initialize(&_Deposit.TransactOpts, _factory) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _factory) returns() +func (_Deposit *DepositTransactorSession) Initialize(_factory common.Address) (*types.Transaction, error) { + return _Deposit.Contract.Initialize(&_Deposit.TransactOpts, _factory) +} + +// InitializeDeposit is a paid mutator transaction binding the contract method 0xa81e63f7. +// +// Solidity: function initializeDeposit(address _tbtcSystem, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachineAddress, uint64 _lotSizeSatoshis) returns() +func (_Deposit *DepositTransactor) InitializeDeposit(opts *bind.TransactOpts, _tbtcSystem common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachineAddress common.Address, _lotSizeSatoshis uint64) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "initializeDeposit", _tbtcSystem, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachineAddress, _lotSizeSatoshis) +} + +// InitializeDeposit is a paid mutator transaction binding the contract method 0xa81e63f7. +// +// Solidity: function initializeDeposit(address _tbtcSystem, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachineAddress, uint64 _lotSizeSatoshis) returns() +func (_Deposit *DepositSession) InitializeDeposit(_tbtcSystem common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachineAddress common.Address, _lotSizeSatoshis uint64) (*types.Transaction, error) { + return _Deposit.Contract.InitializeDeposit(&_Deposit.TransactOpts, _tbtcSystem, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachineAddress, _lotSizeSatoshis) +} + +// InitializeDeposit is a paid mutator transaction binding the contract method 0xa81e63f7. +// +// Solidity: function initializeDeposit(address _tbtcSystem, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachineAddress, uint64 _lotSizeSatoshis) returns() +func (_Deposit *DepositTransactorSession) InitializeDeposit(_tbtcSystem common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachineAddress common.Address, _lotSizeSatoshis uint64) (*types.Transaction, error) { + return _Deposit.Contract.InitializeDeposit(&_Deposit.TransactOpts, _tbtcSystem, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachineAddress, _lotSizeSatoshis) +} + +// NotifyCourtesyCall is a paid mutator transaction binding the contract method 0x96aab311. +// +// Solidity: function notifyCourtesyCall() returns() +func (_Deposit *DepositTransactor) NotifyCourtesyCall(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyCourtesyCall") +} + +// NotifyCourtesyCall is a paid mutator transaction binding the contract method 0x96aab311. +// +// Solidity: function notifyCourtesyCall() returns() +func (_Deposit *DepositSession) NotifyCourtesyCall() (*types.Transaction, error) { + return _Deposit.Contract.NotifyCourtesyCall(&_Deposit.TransactOpts) +} + +// NotifyCourtesyCall is a paid mutator transaction binding the contract method 0x96aab311. +// +// Solidity: function notifyCourtesyCall() returns() +func (_Deposit *DepositTransactorSession) NotifyCourtesyCall() (*types.Transaction, error) { + return _Deposit.Contract.NotifyCourtesyCall(&_Deposit.TransactOpts) +} + +// NotifyCourtesyCallExpired is a paid mutator transaction binding the contract method 0x91d165e3. +// +// Solidity: function notifyCourtesyCallExpired() returns() +func (_Deposit *DepositTransactor) NotifyCourtesyCallExpired(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyCourtesyCallExpired") +} + +// NotifyCourtesyCallExpired is a paid mutator transaction binding the contract method 0x91d165e3. +// +// Solidity: function notifyCourtesyCallExpired() returns() +func (_Deposit *DepositSession) NotifyCourtesyCallExpired() (*types.Transaction, error) { + return _Deposit.Contract.NotifyCourtesyCallExpired(&_Deposit.TransactOpts) +} + +// NotifyCourtesyCallExpired is a paid mutator transaction binding the contract method 0x91d165e3. +// +// Solidity: function notifyCourtesyCallExpired() returns() +func (_Deposit *DepositTransactorSession) NotifyCourtesyCallExpired() (*types.Transaction, error) { + return _Deposit.Contract.NotifyCourtesyCallExpired(&_Deposit.TransactOpts) +} + +// NotifyFundingTimedOut is a paid mutator transaction binding the contract method 0x259b1ea3. +// +// Solidity: function notifyFundingTimedOut() returns() +func (_Deposit *DepositTransactor) NotifyFundingTimedOut(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyFundingTimedOut") +} + +// NotifyFundingTimedOut is a paid mutator transaction binding the contract method 0x259b1ea3. +// +// Solidity: function notifyFundingTimedOut() returns() +func (_Deposit *DepositSession) NotifyFundingTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyFundingTimedOut(&_Deposit.TransactOpts) +} + +// NotifyFundingTimedOut is a paid mutator transaction binding the contract method 0x259b1ea3. +// +// Solidity: function notifyFundingTimedOut() returns() +func (_Deposit *DepositTransactorSession) NotifyFundingTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyFundingTimedOut(&_Deposit.TransactOpts) +} + +// NotifyRedemptionProofTimedOut is a paid mutator transaction binding the contract method 0xba346839. +// +// Solidity: function notifyRedemptionProofTimedOut() returns() +func (_Deposit *DepositTransactor) NotifyRedemptionProofTimedOut(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyRedemptionProofTimedOut") +} + +// NotifyRedemptionProofTimedOut is a paid mutator transaction binding the contract method 0xba346839. +// +// Solidity: function notifyRedemptionProofTimedOut() returns() +func (_Deposit *DepositSession) NotifyRedemptionProofTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyRedemptionProofTimedOut(&_Deposit.TransactOpts) +} + +// NotifyRedemptionProofTimedOut is a paid mutator transaction binding the contract method 0xba346839. +// +// Solidity: function notifyRedemptionProofTimedOut() returns() +func (_Deposit *DepositTransactorSession) NotifyRedemptionProofTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyRedemptionProofTimedOut(&_Deposit.TransactOpts) +} + +// NotifyRedemptionSignatureTimedOut is a paid mutator transaction binding the contract method 0x2b0bc981. +// +// Solidity: function notifyRedemptionSignatureTimedOut() returns() +func (_Deposit *DepositTransactor) NotifyRedemptionSignatureTimedOut(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyRedemptionSignatureTimedOut") +} + +// NotifyRedemptionSignatureTimedOut is a paid mutator transaction binding the contract method 0x2b0bc981. +// +// Solidity: function notifyRedemptionSignatureTimedOut() returns() +func (_Deposit *DepositSession) NotifyRedemptionSignatureTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyRedemptionSignatureTimedOut(&_Deposit.TransactOpts) +} + +// NotifyRedemptionSignatureTimedOut is a paid mutator transaction binding the contract method 0x2b0bc981. +// +// Solidity: function notifyRedemptionSignatureTimedOut() returns() +func (_Deposit *DepositTransactorSession) NotifyRedemptionSignatureTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyRedemptionSignatureTimedOut(&_Deposit.TransactOpts) +} + +// NotifySignerSetupFailed is a paid mutator transaction binding the contract method 0x4f706e44. +// +// Solidity: function notifySignerSetupFailed() returns() +func (_Deposit *DepositTransactor) NotifySignerSetupFailed(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifySignerSetupFailed") +} + +// NotifySignerSetupFailed is a paid mutator transaction binding the contract method 0x4f706e44. +// +// Solidity: function notifySignerSetupFailed() returns() +func (_Deposit *DepositSession) NotifySignerSetupFailed() (*types.Transaction, error) { + return _Deposit.Contract.NotifySignerSetupFailed(&_Deposit.TransactOpts) +} + +// NotifySignerSetupFailed is a paid mutator transaction binding the contract method 0x4f706e44. +// +// Solidity: function notifySignerSetupFailed() returns() +func (_Deposit *DepositTransactorSession) NotifySignerSetupFailed() (*types.Transaction, error) { + return _Deposit.Contract.NotifySignerSetupFailed(&_Deposit.TransactOpts) +} + +// NotifyUndercollateralizedLiquidation is a paid mutator transaction binding the contract method 0xb4bd2e7a. +// +// Solidity: function notifyUndercollateralizedLiquidation() returns() +func (_Deposit *DepositTransactor) NotifyUndercollateralizedLiquidation(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyUndercollateralizedLiquidation") +} + +// NotifyUndercollateralizedLiquidation is a paid mutator transaction binding the contract method 0xb4bd2e7a. +// +// Solidity: function notifyUndercollateralizedLiquidation() returns() +func (_Deposit *DepositSession) NotifyUndercollateralizedLiquidation() (*types.Transaction, error) { + return _Deposit.Contract.NotifyUndercollateralizedLiquidation(&_Deposit.TransactOpts) +} + +// NotifyUndercollateralizedLiquidation is a paid mutator transaction binding the contract method 0xb4bd2e7a. +// +// Solidity: function notifyUndercollateralizedLiquidation() returns() +func (_Deposit *DepositTransactorSession) NotifyUndercollateralizedLiquidation() (*types.Transaction, error) { + return _Deposit.Contract.NotifyUndercollateralizedLiquidation(&_Deposit.TransactOpts) +} + +// ProvideBTCFundingProof is a paid mutator transaction binding the contract method 0xd9f74b0e. +// +// Solidity: function provideBTCFundingProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, uint8 _fundingOutputIndex, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositTransactor) ProvideBTCFundingProof(opts *bind.TransactOpts, _txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _fundingOutputIndex uint8, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideBTCFundingProof", _txVersion, _txInputVector, _txOutputVector, _txLocktime, _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideBTCFundingProof is a paid mutator transaction binding the contract method 0xd9f74b0e. +// +// Solidity: function provideBTCFundingProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, uint8 _fundingOutputIndex, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositSession) ProvideBTCFundingProof(_txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _fundingOutputIndex uint8, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideBTCFundingProof(&_Deposit.TransactOpts, _txVersion, _txInputVector, _txOutputVector, _txLocktime, _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideBTCFundingProof is a paid mutator transaction binding the contract method 0xd9f74b0e. +// +// Solidity: function provideBTCFundingProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, uint8 _fundingOutputIndex, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositTransactorSession) ProvideBTCFundingProof(_txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _fundingOutputIndex uint8, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideBTCFundingProof(&_Deposit.TransactOpts, _txVersion, _txInputVector, _txOutputVector, _txLocktime, _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideECDSAFraudProof is a paid mutator transaction binding the contract method 0xd5eef971. +// +// Solidity: function provideECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositTransactor) ProvideECDSAFraudProof(opts *bind.TransactOpts, _v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideECDSAFraudProof", _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideECDSAFraudProof is a paid mutator transaction binding the contract method 0xd5eef971. +// +// Solidity: function provideECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositSession) ProvideECDSAFraudProof(_v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideECDSAFraudProof(&_Deposit.TransactOpts, _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideECDSAFraudProof is a paid mutator transaction binding the contract method 0xd5eef971. +// +// Solidity: function provideECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositTransactorSession) ProvideECDSAFraudProof(_v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideECDSAFraudProof(&_Deposit.TransactOpts, _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideFundingECDSAFraudProof is a paid mutator transaction binding the contract method 0x2d099442. +// +// Solidity: function provideFundingECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositTransactor) ProvideFundingECDSAFraudProof(opts *bind.TransactOpts, _v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideFundingECDSAFraudProof", _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideFundingECDSAFraudProof is a paid mutator transaction binding the contract method 0x2d099442. +// +// Solidity: function provideFundingECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositSession) ProvideFundingECDSAFraudProof(_v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideFundingECDSAFraudProof(&_Deposit.TransactOpts, _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideFundingECDSAFraudProof is a paid mutator transaction binding the contract method 0x2d099442. +// +// Solidity: function provideFundingECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositTransactorSession) ProvideFundingECDSAFraudProof(_v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideFundingECDSAFraudProof(&_Deposit.TransactOpts, _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideRedemptionProof is a paid mutator transaction binding the contract method 0xd459c416. +// +// Solidity: function provideRedemptionProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositTransactor) ProvideRedemptionProof(opts *bind.TransactOpts, _txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideRedemptionProof", _txVersion, _txInputVector, _txOutputVector, _txLocktime, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideRedemptionProof is a paid mutator transaction binding the contract method 0xd459c416. +// +// Solidity: function provideRedemptionProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositSession) ProvideRedemptionProof(_txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideRedemptionProof(&_Deposit.TransactOpts, _txVersion, _txInputVector, _txOutputVector, _txLocktime, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideRedemptionProof is a paid mutator transaction binding the contract method 0xd459c416. +// +// Solidity: function provideRedemptionProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositTransactorSession) ProvideRedemptionProof(_txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideRedemptionProof(&_Deposit.TransactOpts, _txVersion, _txInputVector, _txOutputVector, _txLocktime, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideRedemptionSignature is a paid mutator transaction binding the contract method 0xc4159559. +// +// Solidity: function provideRedemptionSignature(uint8 _v, bytes32 _r, bytes32 _s) returns() +func (_Deposit *DepositTransactor) ProvideRedemptionSignature(opts *bind.TransactOpts, _v uint8, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideRedemptionSignature", _v, _r, _s) +} + +// ProvideRedemptionSignature is a paid mutator transaction binding the contract method 0xc4159559. +// +// Solidity: function provideRedemptionSignature(uint8 _v, bytes32 _r, bytes32 _s) returns() +func (_Deposit *DepositSession) ProvideRedemptionSignature(_v uint8, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideRedemptionSignature(&_Deposit.TransactOpts, _v, _r, _s) +} + +// ProvideRedemptionSignature is a paid mutator transaction binding the contract method 0xc4159559. +// +// Solidity: function provideRedemptionSignature(uint8 _v, bytes32 _r, bytes32 _s) returns() +func (_Deposit *DepositTransactorSession) ProvideRedemptionSignature(_v uint8, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideRedemptionSignature(&_Deposit.TransactOpts, _v, _r, _s) +} + +// PurchaseSignerBondsAtAuction is a paid mutator transaction binding the contract method 0x2c735daa. +// +// Solidity: function purchaseSignerBondsAtAuction() returns() +func (_Deposit *DepositTransactor) PurchaseSignerBondsAtAuction(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "purchaseSignerBondsAtAuction") +} + +// PurchaseSignerBondsAtAuction is a paid mutator transaction binding the contract method 0x2c735daa. +// +// Solidity: function purchaseSignerBondsAtAuction() returns() +func (_Deposit *DepositSession) PurchaseSignerBondsAtAuction() (*types.Transaction, error) { + return _Deposit.Contract.PurchaseSignerBondsAtAuction(&_Deposit.TransactOpts) +} + +// PurchaseSignerBondsAtAuction is a paid mutator transaction binding the contract method 0x2c735daa. +// +// Solidity: function purchaseSignerBondsAtAuction() returns() +func (_Deposit *DepositTransactorSession) PurchaseSignerBondsAtAuction() (*types.Transaction, error) { + return _Deposit.Contract.PurchaseSignerBondsAtAuction(&_Deposit.TransactOpts) +} + +// RequestFunderAbort is a paid mutator transaction binding the contract method 0x0049ce75. +// +// Solidity: function requestFunderAbort(bytes _abortOutputScript) returns() +func (_Deposit *DepositTransactor) RequestFunderAbort(opts *bind.TransactOpts, _abortOutputScript []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "requestFunderAbort", _abortOutputScript) +} + +// RequestFunderAbort is a paid mutator transaction binding the contract method 0x0049ce75. +// +// Solidity: function requestFunderAbort(bytes _abortOutputScript) returns() +func (_Deposit *DepositSession) RequestFunderAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _Deposit.Contract.RequestFunderAbort(&_Deposit.TransactOpts, _abortOutputScript) +} + +// RequestFunderAbort is a paid mutator transaction binding the contract method 0x0049ce75. +// +// Solidity: function requestFunderAbort(bytes _abortOutputScript) returns() +func (_Deposit *DepositTransactorSession) RequestFunderAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _Deposit.Contract.RequestFunderAbort(&_Deposit.TransactOpts, _abortOutputScript) +} + +// RequestRedemption is a paid mutator transaction binding the contract method 0x994aa931. +// +// Solidity: function requestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript) returns() +func (_Deposit *DepositTransactor) RequestRedemption(opts *bind.TransactOpts, _outputValueBytes [8]byte, _redeemerOutputScript []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "requestRedemption", _outputValueBytes, _redeemerOutputScript) +} + +// RequestRedemption is a paid mutator transaction binding the contract method 0x994aa931. +// +// Solidity: function requestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript) returns() +func (_Deposit *DepositSession) RequestRedemption(_outputValueBytes [8]byte, _redeemerOutputScript []byte) (*types.Transaction, error) { + return _Deposit.Contract.RequestRedemption(&_Deposit.TransactOpts, _outputValueBytes, _redeemerOutputScript) +} + +// RequestRedemption is a paid mutator transaction binding the contract method 0x994aa931. +// +// Solidity: function requestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript) returns() +func (_Deposit *DepositTransactorSession) RequestRedemption(_outputValueBytes [8]byte, _redeemerOutputScript []byte) (*types.Transaction, error) { + return _Deposit.Contract.RequestRedemption(&_Deposit.TransactOpts, _outputValueBytes, _redeemerOutputScript) +} + +// RetrieveSignerPubkey is a paid mutator transaction binding the contract method 0xea3db250. +// +// Solidity: function retrieveSignerPubkey() returns() +func (_Deposit *DepositTransactor) RetrieveSignerPubkey(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "retrieveSignerPubkey") +} + +// RetrieveSignerPubkey is a paid mutator transaction binding the contract method 0xea3db250. +// +// Solidity: function retrieveSignerPubkey() returns() +func (_Deposit *DepositSession) RetrieveSignerPubkey() (*types.Transaction, error) { + return _Deposit.Contract.RetrieveSignerPubkey(&_Deposit.TransactOpts) +} + +// RetrieveSignerPubkey is a paid mutator transaction binding the contract method 0xea3db250. +// +// Solidity: function retrieveSignerPubkey() returns() +func (_Deposit *DepositTransactorSession) RetrieveSignerPubkey() (*types.Transaction, error) { + return _Deposit.Contract.RetrieveSignerPubkey(&_Deposit.TransactOpts) +} + +// TransferAndRequestRedemption is a paid mutator transaction binding the contract method 0xfb7c592a. +// +// Solidity: function transferAndRequestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript, address _finalRecipient) returns() +func (_Deposit *DepositTransactor) TransferAndRequestRedemption(opts *bind.TransactOpts, _outputValueBytes [8]byte, _redeemerOutputScript []byte, _finalRecipient common.Address) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "transferAndRequestRedemption", _outputValueBytes, _redeemerOutputScript, _finalRecipient) +} + +// TransferAndRequestRedemption is a paid mutator transaction binding the contract method 0xfb7c592a. +// +// Solidity: function transferAndRequestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript, address _finalRecipient) returns() +func (_Deposit *DepositSession) TransferAndRequestRedemption(_outputValueBytes [8]byte, _redeemerOutputScript []byte, _finalRecipient common.Address) (*types.Transaction, error) { + return _Deposit.Contract.TransferAndRequestRedemption(&_Deposit.TransactOpts, _outputValueBytes, _redeemerOutputScript, _finalRecipient) +} + +// TransferAndRequestRedemption is a paid mutator transaction binding the contract method 0xfb7c592a. +// +// Solidity: function transferAndRequestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript, address _finalRecipient) returns() +func (_Deposit *DepositTransactorSession) TransferAndRequestRedemption(_outputValueBytes [8]byte, _redeemerOutputScript []byte, _finalRecipient common.Address) (*types.Transaction, error) { + return _Deposit.Contract.TransferAndRequestRedemption(&_Deposit.TransactOpts, _outputValueBytes, _redeemerOutputScript, _finalRecipient) +} + +// WithdrawFunds is a paid mutator transaction binding the contract method 0x24600fc3. +// +// Solidity: function withdrawFunds() returns() +func (_Deposit *DepositTransactor) WithdrawFunds(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "withdrawFunds") +} + +// WithdrawFunds is a paid mutator transaction binding the contract method 0x24600fc3. +// +// Solidity: function withdrawFunds() returns() +func (_Deposit *DepositSession) WithdrawFunds() (*types.Transaction, error) { + return _Deposit.Contract.WithdrawFunds(&_Deposit.TransactOpts) +} + +// WithdrawFunds is a paid mutator transaction binding the contract method 0x24600fc3. +// +// Solidity: function withdrawFunds() returns() +func (_Deposit *DepositTransactorSession) WithdrawFunds() (*types.Transaction, error) { + return _Deposit.Contract.WithdrawFunds(&_Deposit.TransactOpts) +} diff --git a/pkg/chain/ethereum/gen/abi/system/TBTCSystem.go b/pkg/chain/ethereum/gen/abi/system/TBTCSystem.go new file mode 100644 index 000000000..549c5df6b --- /dev/null +++ b/pkg/chain/ethereum/gen/abi/system/TBTCSystem.go @@ -0,0 +1,5145 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abi + +import ( + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// TBTCSystemABI is the input ABI used to generate the binding from. +const TBTCSystemABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_priceFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_relay\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_allowNewDeposits\",\"type\":\"bool\"}],\"name\":\"AllowNewDepositsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_initialCollateralizedPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_undercollateralizedThresholdPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_severelyUndercollateralizedThresholdPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"CollateralizationThresholdsUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_initialCollateralizedPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_undercollateralizedThresholdPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_severelyUndercollateralizedThresholdPercent\",\"type\":\"uint16\"}],\"name\":\"CollateralizationThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"CourtesyCalled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_keepAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Created\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_priceFeed\",\"type\":\"address\"}],\"name\":\"EthBtcPriceFeedAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_priceFeed\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"EthBtcPriceFeedAdditionStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"ExitedCourtesyCall\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"FraudDuringSetup\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Funded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"FunderAbortRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"GotRedemptionSignature\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_keepStakedFactory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_fullyBackedFactory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_factorySelector\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"KeepFactoriesUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_keepStakedFactory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_fullyBackedFactory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_factorySelector\",\"type\":\"address\"}],\"name\":\"KeepFactoriesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Liquidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"_lotSizes\",\"type\":\"uint64[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"LotSizesUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"_lotSizes\",\"type\":\"uint64[]\"}],\"name\":\"LotSizesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Redeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_utxoValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_requestedFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_outpoint\",\"type\":\"bytes\"}],\"name\":\"RedemptionRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyX\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyY\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"RegisteredPubkey\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"SetupFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_signerFeeDivisor\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"SignerFeeDivisorUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_signerFeeDivisor\",\"type\":\"uint16\"}],\"name\":\"SignerFeeDivisorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_wasFraud\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"StartedLiquidation\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_caller\",\"type\":\"address\"}],\"name\":\"approvedToLog\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_initialCollateralizedPercent\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_undercollateralizedThresholdPercent\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_severelyUndercollateralizedThresholdPercent\",\"type\":\"uint16\"}],\"name\":\"beginCollateralizationThresholdsUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contractIMedianizer\",\"name\":\"_ethBtcPriceFeed\",\"type\":\"address\"}],\"name\":\"beginEthBtcPriceFeedAddition\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_keepStakedFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_fullyBackedFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_factorySelector\",\"type\":\"address\"}],\"name\":\"beginKeepFactoriesUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"_lotSizes\",\"type\":\"uint64[]\"}],\"name\":\"beginLotSizesUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_signerFeeDivisor\",\"type\":\"uint16\"}],\"name\":\"beginSignerFeeDivisorUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"emergencyPauseNewDeposits\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fetchBitcoinPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fetchRelayCurrentDifficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fetchRelayPreviousDifficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeCollateralizationThresholdsUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeEthBtcPriceFeedAddition\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeKeepFactoriesUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeLotSizesUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeSignerFeeDivisorUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getAllowNewDeposits\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getAllowedLotSizes\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getGovernanceTimeDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getInitialCollateralizedPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getKeepFactoriesUpgradeabilityPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getMaximumLotSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getMinimumLotSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNewDepositFeeEstimate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPriceFeedGovernanceTimeDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingCollateralizationThresholdsUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingEthBtcPriceFeedAdditionTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingKeepFactoriesUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingKeepFactoriesUpgradeabilityTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingLotSizesUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingPauseTerm\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingSignerFeeDivisorUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getSeverelyUndercollateralizedThresholdPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getSignerFeeDivisor\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getUndercollateralizedThresholdPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contractIBondedECDSAKeepFactory\",\"name\":\"_defaultKeepFactory\",\"type\":\"address\"},{\"internalType\":\"contractDepositFactory\",\"name\":\"_depositFactory\",\"type\":\"address\"},{\"internalType\":\"addresspayable\",\"name\":\"_masterDepositAddress\",\"type\":\"address\"},{\"internalType\":\"contractTBTCToken\",\"name\":\"_tbtcToken\",\"type\":\"address\"},{\"internalType\":\"contractTBTCDepositToken\",\"name\":\"_tbtcDepositToken\",\"type\":\"address\"},{\"internalType\":\"contractFeeRebateToken\",\"name\":\"_feeRebateToken\",\"type\":\"address\"},{\"internalType\":\"contractVendingMachine\",\"name\":\"_vendingMachine\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_keepThreshold\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_keepSize\",\"type\":\"uint16\"}],\"name\":\"initialize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_requestedLotSizeSatoshis\",\"type\":\"uint64\"}],\"name\":\"isAllowedLotSize\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"keepSize\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"keepThreshold\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logCourtesyCalled\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_keepAddress\",\"type\":\"address\"}],\"name\":\"logCreated\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logExitedCourtesyCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logFraudDuringSetup\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"logFunded\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"logFunderRequestedAbort\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"}],\"name\":\"logGotRedemptionSignature\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logLiquidated\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"logRedeemed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_requester\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_utxoValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_requestedFee\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_outpoint\",\"type\":\"bytes\"}],\"name\":\"logRedemptionRequested\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyX\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyY\",\"type\":\"bytes32\"}],\"name\":\"logRegisteredPubkey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logSetupFailed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_wasFraud\",\"type\":\"bool\"}],\"name\":\"logStartedLiquidation\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"priceFeed\",\"outputs\":[{\"internalType\":\"contractISatWeiPriceFeed\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"refreshMinimumBondableValue\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"relay\",\"outputs\":[{\"internalType\":\"contractIRelay\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_requestedLotSizeSatoshis\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_maxSecuredLifetime\",\"type\":\"uint256\"}],\"name\":\"requestNewKeep\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"resumeNewDeposits\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + +// TBTCSystem is an auto generated Go binding around an Ethereum contract. +type TBTCSystem struct { + TBTCSystemCaller // Read-only binding to the contract + TBTCSystemTransactor // Write-only binding to the contract + TBTCSystemFilterer // Log filterer for contract events +} + +// TBTCSystemCaller is an auto generated read-only Go binding around an Ethereum contract. +type TBTCSystemCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TBTCSystemTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TBTCSystemTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TBTCSystemFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TBTCSystemFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TBTCSystemSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TBTCSystemSession struct { + Contract *TBTCSystem // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TBTCSystemCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TBTCSystemCallerSession struct { + Contract *TBTCSystemCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TBTCSystemTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TBTCSystemTransactorSession struct { + Contract *TBTCSystemTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TBTCSystemRaw is an auto generated low-level Go binding around an Ethereum contract. +type TBTCSystemRaw struct { + Contract *TBTCSystem // Generic contract binding to access the raw methods on +} + +// TBTCSystemCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TBTCSystemCallerRaw struct { + Contract *TBTCSystemCaller // Generic read-only contract binding to access the raw methods on +} + +// TBTCSystemTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TBTCSystemTransactorRaw struct { + Contract *TBTCSystemTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTBTCSystem creates a new instance of TBTCSystem, bound to a specific deployed contract. +func NewTBTCSystem(address common.Address, backend bind.ContractBackend) (*TBTCSystem, error) { + contract, err := bindTBTCSystem(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TBTCSystem{TBTCSystemCaller: TBTCSystemCaller{contract: contract}, TBTCSystemTransactor: TBTCSystemTransactor{contract: contract}, TBTCSystemFilterer: TBTCSystemFilterer{contract: contract}}, nil +} + +// NewTBTCSystemCaller creates a new read-only instance of TBTCSystem, bound to a specific deployed contract. +func NewTBTCSystemCaller(address common.Address, caller bind.ContractCaller) (*TBTCSystemCaller, error) { + contract, err := bindTBTCSystem(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TBTCSystemCaller{contract: contract}, nil +} + +// NewTBTCSystemTransactor creates a new write-only instance of TBTCSystem, bound to a specific deployed contract. +func NewTBTCSystemTransactor(address common.Address, transactor bind.ContractTransactor) (*TBTCSystemTransactor, error) { + contract, err := bindTBTCSystem(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TBTCSystemTransactor{contract: contract}, nil +} + +// NewTBTCSystemFilterer creates a new log filterer instance of TBTCSystem, bound to a specific deployed contract. +func NewTBTCSystemFilterer(address common.Address, filterer bind.ContractFilterer) (*TBTCSystemFilterer, error) { + contract, err := bindTBTCSystem(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TBTCSystemFilterer{contract: contract}, nil +} + +// bindTBTCSystem binds a generic wrapper to an already deployed contract. +func bindTBTCSystem(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(TBTCSystemABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TBTCSystem *TBTCSystemRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _TBTCSystem.Contract.TBTCSystemCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TBTCSystem *TBTCSystemRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.Contract.TBTCSystemTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TBTCSystem *TBTCSystemRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TBTCSystem.Contract.TBTCSystemTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TBTCSystem *TBTCSystemCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _TBTCSystem.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TBTCSystem *TBTCSystemTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TBTCSystem *TBTCSystemTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TBTCSystem.Contract.contract.Transact(opts, method, params...) +} + +// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. +// +// Solidity: function approvedToLog(address _caller) constant returns(bool) +func (_TBTCSystem *TBTCSystemCaller) ApprovedToLog(opts *bind.CallOpts, _caller common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "approvedToLog", _caller) + return *ret0, err +} + +// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. +// +// Solidity: function approvedToLog(address _caller) constant returns(bool) +func (_TBTCSystem *TBTCSystemSession) ApprovedToLog(_caller common.Address) (bool, error) { + return _TBTCSystem.Contract.ApprovedToLog(&_TBTCSystem.CallOpts, _caller) +} + +// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. +// +// Solidity: function approvedToLog(address _caller) constant returns(bool) +func (_TBTCSystem *TBTCSystemCallerSession) ApprovedToLog(_caller common.Address) (bool, error) { + return _TBTCSystem.Contract.ApprovedToLog(&_TBTCSystem.CallOpts, _caller) +} + +// FetchBitcoinPrice is a free data retrieval call binding the contract method 0xa6c1691c. +// +// Solidity: function fetchBitcoinPrice() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) FetchBitcoinPrice(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "fetchBitcoinPrice") + return *ret0, err +} + +// FetchBitcoinPrice is a free data retrieval call binding the contract method 0xa6c1691c. +// +// Solidity: function fetchBitcoinPrice() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) FetchBitcoinPrice() (*big.Int, error) { + return _TBTCSystem.Contract.FetchBitcoinPrice(&_TBTCSystem.CallOpts) +} + +// FetchBitcoinPrice is a free data retrieval call binding the contract method 0xa6c1691c. +// +// Solidity: function fetchBitcoinPrice() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) FetchBitcoinPrice() (*big.Int, error) { + return _TBTCSystem.Contract.FetchBitcoinPrice(&_TBTCSystem.CallOpts) +} + +// FetchRelayCurrentDifficulty is a free data retrieval call binding the contract method 0xdab70cb1. +// +// Solidity: function fetchRelayCurrentDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) FetchRelayCurrentDifficulty(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "fetchRelayCurrentDifficulty") + return *ret0, err +} + +// FetchRelayCurrentDifficulty is a free data retrieval call binding the contract method 0xdab70cb1. +// +// Solidity: function fetchRelayCurrentDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) FetchRelayCurrentDifficulty() (*big.Int, error) { + return _TBTCSystem.Contract.FetchRelayCurrentDifficulty(&_TBTCSystem.CallOpts) +} + +// FetchRelayCurrentDifficulty is a free data retrieval call binding the contract method 0xdab70cb1. +// +// Solidity: function fetchRelayCurrentDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) FetchRelayCurrentDifficulty() (*big.Int, error) { + return _TBTCSystem.Contract.FetchRelayCurrentDifficulty(&_TBTCSystem.CallOpts) +} + +// FetchRelayPreviousDifficulty is a free data retrieval call binding the contract method 0x402b783d. +// +// Solidity: function fetchRelayPreviousDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) FetchRelayPreviousDifficulty(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "fetchRelayPreviousDifficulty") + return *ret0, err +} + +// FetchRelayPreviousDifficulty is a free data retrieval call binding the contract method 0x402b783d. +// +// Solidity: function fetchRelayPreviousDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) FetchRelayPreviousDifficulty() (*big.Int, error) { + return _TBTCSystem.Contract.FetchRelayPreviousDifficulty(&_TBTCSystem.CallOpts) +} + +// FetchRelayPreviousDifficulty is a free data retrieval call binding the contract method 0x402b783d. +// +// Solidity: function fetchRelayPreviousDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) FetchRelayPreviousDifficulty() (*big.Int, error) { + return _TBTCSystem.Contract.FetchRelayPreviousDifficulty(&_TBTCSystem.CallOpts) +} + +// GetAllowNewDeposits is a free data retrieval call binding the contract method 0x0d7eb1c4. +// +// Solidity: function getAllowNewDeposits() constant returns(bool) +func (_TBTCSystem *TBTCSystemCaller) GetAllowNewDeposits(opts *bind.CallOpts) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getAllowNewDeposits") + return *ret0, err +} + +// GetAllowNewDeposits is a free data retrieval call binding the contract method 0x0d7eb1c4. +// +// Solidity: function getAllowNewDeposits() constant returns(bool) +func (_TBTCSystem *TBTCSystemSession) GetAllowNewDeposits() (bool, error) { + return _TBTCSystem.Contract.GetAllowNewDeposits(&_TBTCSystem.CallOpts) +} + +// GetAllowNewDeposits is a free data retrieval call binding the contract method 0x0d7eb1c4. +// +// Solidity: function getAllowNewDeposits() constant returns(bool) +func (_TBTCSystem *TBTCSystemCallerSession) GetAllowNewDeposits() (bool, error) { + return _TBTCSystem.Contract.GetAllowNewDeposits(&_TBTCSystem.CallOpts) +} + +// GetAllowedLotSizes is a free data retrieval call binding the contract method 0x086c9edd. +// +// Solidity: function getAllowedLotSizes() constant returns(uint64[]) +func (_TBTCSystem *TBTCSystemCaller) GetAllowedLotSizes(opts *bind.CallOpts) ([]uint64, error) { + var ( + ret0 = new([]uint64) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getAllowedLotSizes") + return *ret0, err +} + +// GetAllowedLotSizes is a free data retrieval call binding the contract method 0x086c9edd. +// +// Solidity: function getAllowedLotSizes() constant returns(uint64[]) +func (_TBTCSystem *TBTCSystemSession) GetAllowedLotSizes() ([]uint64, error) { + return _TBTCSystem.Contract.GetAllowedLotSizes(&_TBTCSystem.CallOpts) +} + +// GetAllowedLotSizes is a free data retrieval call binding the contract method 0x086c9edd. +// +// Solidity: function getAllowedLotSizes() constant returns(uint64[]) +func (_TBTCSystem *TBTCSystemCallerSession) GetAllowedLotSizes() ([]uint64, error) { + return _TBTCSystem.Contract.GetAllowedLotSizes(&_TBTCSystem.CallOpts) +} + +// GetGovernanceTimeDelay is a free data retrieval call binding the contract method 0xf2e72347. +// +// Solidity: function getGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetGovernanceTimeDelay(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getGovernanceTimeDelay") + return *ret0, err +} + +// GetGovernanceTimeDelay is a free data retrieval call binding the contract method 0xf2e72347. +// +// Solidity: function getGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetGovernanceTimeDelay() (*big.Int, error) { + return _TBTCSystem.Contract.GetGovernanceTimeDelay(&_TBTCSystem.CallOpts) +} + +// GetGovernanceTimeDelay is a free data retrieval call binding the contract method 0xf2e72347. +// +// Solidity: function getGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetGovernanceTimeDelay() (*big.Int, error) { + return _TBTCSystem.Contract.GetGovernanceTimeDelay(&_TBTCSystem.CallOpts) +} + +// GetInitialCollateralizedPercent is a free data retrieval call binding the contract method 0x987ecea7. +// +// Solidity: function getInitialCollateralizedPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) GetInitialCollateralizedPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getInitialCollateralizedPercent") + return *ret0, err +} + +// GetInitialCollateralizedPercent is a free data retrieval call binding the contract method 0x987ecea7. +// +// Solidity: function getInitialCollateralizedPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) GetInitialCollateralizedPercent() (uint16, error) { + return _TBTCSystem.Contract.GetInitialCollateralizedPercent(&_TBTCSystem.CallOpts) +} + +// GetInitialCollateralizedPercent is a free data retrieval call binding the contract method 0x987ecea7. +// +// Solidity: function getInitialCollateralizedPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) GetInitialCollateralizedPercent() (uint16, error) { + return _TBTCSystem.Contract.GetInitialCollateralizedPercent(&_TBTCSystem.CallOpts) +} + +// GetKeepFactoriesUpgradeabilityPeriod is a free data retrieval call binding the contract method 0xe5a6d77d. +// +// Solidity: function getKeepFactoriesUpgradeabilityPeriod() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetKeepFactoriesUpgradeabilityPeriod(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getKeepFactoriesUpgradeabilityPeriod") + return *ret0, err +} + +// GetKeepFactoriesUpgradeabilityPeriod is a free data retrieval call binding the contract method 0xe5a6d77d. +// +// Solidity: function getKeepFactoriesUpgradeabilityPeriod() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { + return _TBTCSystem.Contract.GetKeepFactoriesUpgradeabilityPeriod(&_TBTCSystem.CallOpts) +} + +// GetKeepFactoriesUpgradeabilityPeriod is a free data retrieval call binding the contract method 0xe5a6d77d. +// +// Solidity: function getKeepFactoriesUpgradeabilityPeriod() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { + return _TBTCSystem.Contract.GetKeepFactoriesUpgradeabilityPeriod(&_TBTCSystem.CallOpts) +} + +// GetMaximumLotSize is a free data retrieval call binding the contract method 0x2753d84b. +// +// Solidity: function getMaximumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetMaximumLotSize(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getMaximumLotSize") + return *ret0, err +} + +// GetMaximumLotSize is a free data retrieval call binding the contract method 0x2753d84b. +// +// Solidity: function getMaximumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetMaximumLotSize() (*big.Int, error) { + return _TBTCSystem.Contract.GetMaximumLotSize(&_TBTCSystem.CallOpts) +} + +// GetMaximumLotSize is a free data retrieval call binding the contract method 0x2753d84b. +// +// Solidity: function getMaximumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetMaximumLotSize() (*big.Int, error) { + return _TBTCSystem.Contract.GetMaximumLotSize(&_TBTCSystem.CallOpts) +} + +// GetMinimumLotSize is a free data retrieval call binding the contract method 0x34d534a9. +// +// Solidity: function getMinimumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetMinimumLotSize(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getMinimumLotSize") + return *ret0, err +} + +// GetMinimumLotSize is a free data retrieval call binding the contract method 0x34d534a9. +// +// Solidity: function getMinimumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetMinimumLotSize() (*big.Int, error) { + return _TBTCSystem.Contract.GetMinimumLotSize(&_TBTCSystem.CallOpts) +} + +// GetMinimumLotSize is a free data retrieval call binding the contract method 0x34d534a9. +// +// Solidity: function getMinimumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetMinimumLotSize() (*big.Int, error) { + return _TBTCSystem.Contract.GetMinimumLotSize(&_TBTCSystem.CallOpts) +} + +// GetNewDepositFeeEstimate is a free data retrieval call binding the contract method 0x2d00f1ee. +// +// Solidity: function getNewDepositFeeEstimate() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetNewDepositFeeEstimate(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getNewDepositFeeEstimate") + return *ret0, err +} + +// GetNewDepositFeeEstimate is a free data retrieval call binding the contract method 0x2d00f1ee. +// +// Solidity: function getNewDepositFeeEstimate() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetNewDepositFeeEstimate() (*big.Int, error) { + return _TBTCSystem.Contract.GetNewDepositFeeEstimate(&_TBTCSystem.CallOpts) +} + +// GetNewDepositFeeEstimate is a free data retrieval call binding the contract method 0x2d00f1ee. +// +// Solidity: function getNewDepositFeeEstimate() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetNewDepositFeeEstimate() (*big.Int, error) { + return _TBTCSystem.Contract.GetNewDepositFeeEstimate(&_TBTCSystem.CallOpts) +} + +// GetPriceFeedGovernanceTimeDelay is a free data retrieval call binding the contract method 0xae7f4a5f. +// +// Solidity: function getPriceFeedGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetPriceFeedGovernanceTimeDelay(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getPriceFeedGovernanceTimeDelay") + return *ret0, err +} + +// GetPriceFeedGovernanceTimeDelay is a free data retrieval call binding the contract method 0xae7f4a5f. +// +// Solidity: function getPriceFeedGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { + return _TBTCSystem.Contract.GetPriceFeedGovernanceTimeDelay(&_TBTCSystem.CallOpts) +} + +// GetPriceFeedGovernanceTimeDelay is a free data retrieval call binding the contract method 0xae7f4a5f. +// +// Solidity: function getPriceFeedGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { + return _TBTCSystem.Contract.GetPriceFeedGovernanceTimeDelay(&_TBTCSystem.CallOpts) +} + +// GetRemainingCollateralizationThresholdsUpdateTime is a free data retrieval call binding the contract method 0xc074d550. +// +// Solidity: function getRemainingCollateralizationThresholdsUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingCollateralizationThresholdsUpdateTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingCollateralizationThresholdsUpdateTime") + return *ret0, err +} + +// GetRemainingCollateralizationThresholdsUpdateTime is a free data retrieval call binding the contract method 0xc074d550. +// +// Solidity: function getRemainingCollateralizationThresholdsUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingCollateralizationThresholdsUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingCollateralizationThresholdsUpdateTime is a free data retrieval call binding the contract method 0xc074d550. +// +// Solidity: function getRemainingCollateralizationThresholdsUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingCollateralizationThresholdsUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingEthBtcPriceFeedAdditionTime is a free data retrieval call binding the contract method 0x0af488f9. +// +// Solidity: function getRemainingEthBtcPriceFeedAdditionTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingEthBtcPriceFeedAdditionTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingEthBtcPriceFeedAdditionTime") + return *ret0, err +} + +// GetRemainingEthBtcPriceFeedAdditionTime is a free data retrieval call binding the contract method 0x0af488f9. +// +// Solidity: function getRemainingEthBtcPriceFeedAdditionTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingEthBtcPriceFeedAdditionTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingEthBtcPriceFeedAdditionTime is a free data retrieval call binding the contract method 0x0af488f9. +// +// Solidity: function getRemainingEthBtcPriceFeedAdditionTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingEthBtcPriceFeedAdditionTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingKeepFactoriesUpdateTime is a free data retrieval call binding the contract method 0x57535088. +// +// Solidity: function getRemainingKeepFactoriesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingKeepFactoriesUpdateTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingKeepFactoriesUpdateTime") + return *ret0, err +} + +// GetRemainingKeepFactoriesUpdateTime is a free data retrieval call binding the contract method 0x57535088. +// +// Solidity: function getRemainingKeepFactoriesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingKeepFactoriesUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingKeepFactoriesUpdateTime is a free data retrieval call binding the contract method 0x57535088. +// +// Solidity: function getRemainingKeepFactoriesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingKeepFactoriesUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingKeepFactoriesUpgradeabilityTime is a free data retrieval call binding the contract method 0xb196b5a3. +// +// Solidity: function getRemainingKeepFactoriesUpgradeabilityTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingKeepFactoriesUpgradeabilityTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingKeepFactoriesUpgradeabilityTime") + return *ret0, err +} + +// GetRemainingKeepFactoriesUpgradeabilityTime is a free data retrieval call binding the contract method 0xb196b5a3. +// +// Solidity: function getRemainingKeepFactoriesUpgradeabilityTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingKeepFactoriesUpgradeabilityTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingKeepFactoriesUpgradeabilityTime is a free data retrieval call binding the contract method 0xb196b5a3. +// +// Solidity: function getRemainingKeepFactoriesUpgradeabilityTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingKeepFactoriesUpgradeabilityTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingLotSizesUpdateTime is a free data retrieval call binding the contract method 0x3ee850bc. +// +// Solidity: function getRemainingLotSizesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingLotSizesUpdateTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingLotSizesUpdateTime") + return *ret0, err +} + +// GetRemainingLotSizesUpdateTime is a free data retrieval call binding the contract method 0x3ee850bc. +// +// Solidity: function getRemainingLotSizesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingLotSizesUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingLotSizesUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingLotSizesUpdateTime is a free data retrieval call binding the contract method 0x3ee850bc. +// +// Solidity: function getRemainingLotSizesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingLotSizesUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingLotSizesUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingPauseTerm is a free data retrieval call binding the contract method 0x013b0f30. +// +// Solidity: function getRemainingPauseTerm() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingPauseTerm(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingPauseTerm") + return *ret0, err +} + +// GetRemainingPauseTerm is a free data retrieval call binding the contract method 0x013b0f30. +// +// Solidity: function getRemainingPauseTerm() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingPauseTerm() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingPauseTerm(&_TBTCSystem.CallOpts) +} + +// GetRemainingPauseTerm is a free data retrieval call binding the contract method 0x013b0f30. +// +// Solidity: function getRemainingPauseTerm() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingPauseTerm() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingPauseTerm(&_TBTCSystem.CallOpts) +} + +// GetRemainingSignerFeeDivisorUpdateTime is a free data retrieval call binding the contract method 0xb792a38e. +// +// Solidity: function getRemainingSignerFeeDivisorUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingSignerFeeDivisorUpdateTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingSignerFeeDivisorUpdateTime") + return *ret0, err +} + +// GetRemainingSignerFeeDivisorUpdateTime is a free data retrieval call binding the contract method 0xb792a38e. +// +// Solidity: function getRemainingSignerFeeDivisorUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingSignerFeeDivisorUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingSignerFeeDivisorUpdateTime is a free data retrieval call binding the contract method 0xb792a38e. +// +// Solidity: function getRemainingSignerFeeDivisorUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingSignerFeeDivisorUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetSeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x6f4fef62. +// +// Solidity: function getSeverelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) GetSeverelyUndercollateralizedThresholdPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getSeverelyUndercollateralizedThresholdPercent") + return *ret0, err +} + +// GetSeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x6f4fef62. +// +// Solidity: function getSeverelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + return _TBTCSystem.Contract.GetSeverelyUndercollateralizedThresholdPercent(&_TBTCSystem.CallOpts) +} + +// GetSeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x6f4fef62. +// +// Solidity: function getSeverelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + return _TBTCSystem.Contract.GetSeverelyUndercollateralizedThresholdPercent(&_TBTCSystem.CallOpts) +} + +// GetSignerFeeDivisor is a free data retrieval call binding the contract method 0x60e98d59. +// +// Solidity: function getSignerFeeDivisor() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) GetSignerFeeDivisor(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getSignerFeeDivisor") + return *ret0, err +} + +// GetSignerFeeDivisor is a free data retrieval call binding the contract method 0x60e98d59. +// +// Solidity: function getSignerFeeDivisor() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) GetSignerFeeDivisor() (uint16, error) { + return _TBTCSystem.Contract.GetSignerFeeDivisor(&_TBTCSystem.CallOpts) +} + +// GetSignerFeeDivisor is a free data retrieval call binding the contract method 0x60e98d59. +// +// Solidity: function getSignerFeeDivisor() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) GetSignerFeeDivisor() (uint16, error) { + return _TBTCSystem.Contract.GetSignerFeeDivisor(&_TBTCSystem.CallOpts) +} + +// GetUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0xa2cd75da. +// +// Solidity: function getUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) GetUndercollateralizedThresholdPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getUndercollateralizedThresholdPercent") + return *ret0, err +} + +// GetUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0xa2cd75da. +// +// Solidity: function getUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) GetUndercollateralizedThresholdPercent() (uint16, error) { + return _TBTCSystem.Contract.GetUndercollateralizedThresholdPercent(&_TBTCSystem.CallOpts) +} + +// GetUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0xa2cd75da. +// +// Solidity: function getUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) GetUndercollateralizedThresholdPercent() (uint16, error) { + return _TBTCSystem.Contract.GetUndercollateralizedThresholdPercent(&_TBTCSystem.CallOpts) +} + +// IsAllowedLotSize is a free data retrieval call binding the contract method 0xa28b79f1. +// +// Solidity: function isAllowedLotSize(uint64 _requestedLotSizeSatoshis) constant returns(bool) +func (_TBTCSystem *TBTCSystemCaller) IsAllowedLotSize(opts *bind.CallOpts, _requestedLotSizeSatoshis uint64) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "isAllowedLotSize", _requestedLotSizeSatoshis) + return *ret0, err +} + +// IsAllowedLotSize is a free data retrieval call binding the contract method 0xa28b79f1. +// +// Solidity: function isAllowedLotSize(uint64 _requestedLotSizeSatoshis) constant returns(bool) +func (_TBTCSystem *TBTCSystemSession) IsAllowedLotSize(_requestedLotSizeSatoshis uint64) (bool, error) { + return _TBTCSystem.Contract.IsAllowedLotSize(&_TBTCSystem.CallOpts, _requestedLotSizeSatoshis) +} + +// IsAllowedLotSize is a free data retrieval call binding the contract method 0xa28b79f1. +// +// Solidity: function isAllowedLotSize(uint64 _requestedLotSizeSatoshis) constant returns(bool) +func (_TBTCSystem *TBTCSystemCallerSession) IsAllowedLotSize(_requestedLotSizeSatoshis uint64) (bool, error) { + return _TBTCSystem.Contract.IsAllowedLotSize(&_TBTCSystem.CallOpts, _requestedLotSizeSatoshis) +} + +// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. +// +// Solidity: function isOwner() constant returns(bool) +func (_TBTCSystem *TBTCSystemCaller) IsOwner(opts *bind.CallOpts) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "isOwner") + return *ret0, err +} + +// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. +// +// Solidity: function isOwner() constant returns(bool) +func (_TBTCSystem *TBTCSystemSession) IsOwner() (bool, error) { + return _TBTCSystem.Contract.IsOwner(&_TBTCSystem.CallOpts) +} + +// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. +// +// Solidity: function isOwner() constant returns(bool) +func (_TBTCSystem *TBTCSystemCallerSession) IsOwner() (bool, error) { + return _TBTCSystem.Contract.IsOwner(&_TBTCSystem.CallOpts) +} + +// KeepSize is a free data retrieval call binding the contract method 0x64bdb667. +// +// Solidity: function keepSize() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) KeepSize(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "keepSize") + return *ret0, err +} + +// KeepSize is a free data retrieval call binding the contract method 0x64bdb667. +// +// Solidity: function keepSize() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) KeepSize() (uint16, error) { + return _TBTCSystem.Contract.KeepSize(&_TBTCSystem.CallOpts) +} + +// KeepSize is a free data retrieval call binding the contract method 0x64bdb667. +// +// Solidity: function keepSize() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) KeepSize() (uint16, error) { + return _TBTCSystem.Contract.KeepSize(&_TBTCSystem.CallOpts) +} + +// KeepThreshold is a free data retrieval call binding the contract method 0xe5426d2e. +// +// Solidity: function keepThreshold() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) KeepThreshold(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "keepThreshold") + return *ret0, err +} + +// KeepThreshold is a free data retrieval call binding the contract method 0xe5426d2e. +// +// Solidity: function keepThreshold() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) KeepThreshold() (uint16, error) { + return _TBTCSystem.Contract.KeepThreshold(&_TBTCSystem.CallOpts) +} + +// KeepThreshold is a free data retrieval call binding the contract method 0xe5426d2e. +// +// Solidity: function keepThreshold() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) KeepThreshold() (uint16, error) { + return _TBTCSystem.Contract.KeepThreshold(&_TBTCSystem.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() constant returns(address) +func (_TBTCSystem *TBTCSystemCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "owner") + return *ret0, err +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() constant returns(address) +func (_TBTCSystem *TBTCSystemSession) Owner() (common.Address, error) { + return _TBTCSystem.Contract.Owner(&_TBTCSystem.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() constant returns(address) +func (_TBTCSystem *TBTCSystemCallerSession) Owner() (common.Address, error) { + return _TBTCSystem.Contract.Owner(&_TBTCSystem.CallOpts) +} + +// PriceFeed is a free data retrieval call binding the contract method 0x741bef1a. +// +// Solidity: function priceFeed() constant returns(address) +func (_TBTCSystem *TBTCSystemCaller) PriceFeed(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "priceFeed") + return *ret0, err +} + +// PriceFeed is a free data retrieval call binding the contract method 0x741bef1a. +// +// Solidity: function priceFeed() constant returns(address) +func (_TBTCSystem *TBTCSystemSession) PriceFeed() (common.Address, error) { + return _TBTCSystem.Contract.PriceFeed(&_TBTCSystem.CallOpts) +} + +// PriceFeed is a free data retrieval call binding the contract method 0x741bef1a. +// +// Solidity: function priceFeed() constant returns(address) +func (_TBTCSystem *TBTCSystemCallerSession) PriceFeed() (common.Address, error) { + return _TBTCSystem.Contract.PriceFeed(&_TBTCSystem.CallOpts) +} + +// Relay is a free data retrieval call binding the contract method 0xb59589d1. +// +// Solidity: function relay() constant returns(address) +func (_TBTCSystem *TBTCSystemCaller) Relay(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "relay") + return *ret0, err +} + +// Relay is a free data retrieval call binding the contract method 0xb59589d1. +// +// Solidity: function relay() constant returns(address) +func (_TBTCSystem *TBTCSystemSession) Relay() (common.Address, error) { + return _TBTCSystem.Contract.Relay(&_TBTCSystem.CallOpts) +} + +// Relay is a free data retrieval call binding the contract method 0xb59589d1. +// +// Solidity: function relay() constant returns(address) +func (_TBTCSystem *TBTCSystemCallerSession) Relay() (common.Address, error) { + return _TBTCSystem.Contract.Relay(&_TBTCSystem.CallOpts) +} + +// BeginCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xdde3fdd2. +// +// Solidity: function beginCollateralizationThresholdsUpdate(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginCollateralizationThresholdsUpdate(opts *bind.TransactOpts, _initialCollateralizedPercent uint16, _undercollateralizedThresholdPercent uint16, _severelyUndercollateralizedThresholdPercent uint16) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginCollateralizationThresholdsUpdate", _initialCollateralizedPercent, _undercollateralizedThresholdPercent, _severelyUndercollateralizedThresholdPercent) +} + +// BeginCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xdde3fdd2. +// +// Solidity: function beginCollateralizationThresholdsUpdate(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) returns() +func (_TBTCSystem *TBTCSystemSession) BeginCollateralizationThresholdsUpdate(_initialCollateralizedPercent uint16, _undercollateralizedThresholdPercent uint16, _severelyUndercollateralizedThresholdPercent uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginCollateralizationThresholdsUpdate(&_TBTCSystem.TransactOpts, _initialCollateralizedPercent, _undercollateralizedThresholdPercent, _severelyUndercollateralizedThresholdPercent) +} + +// BeginCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xdde3fdd2. +// +// Solidity: function beginCollateralizationThresholdsUpdate(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginCollateralizationThresholdsUpdate(_initialCollateralizedPercent uint16, _undercollateralizedThresholdPercent uint16, _severelyUndercollateralizedThresholdPercent uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginCollateralizationThresholdsUpdate(&_TBTCSystem.TransactOpts, _initialCollateralizedPercent, _undercollateralizedThresholdPercent, _severelyUndercollateralizedThresholdPercent) +} + +// BeginEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0x07a3d659. +// +// Solidity: function beginEthBtcPriceFeedAddition(address _ethBtcPriceFeed) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginEthBtcPriceFeedAddition(opts *bind.TransactOpts, _ethBtcPriceFeed common.Address) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginEthBtcPriceFeedAddition", _ethBtcPriceFeed) +} + +// BeginEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0x07a3d659. +// +// Solidity: function beginEthBtcPriceFeedAddition(address _ethBtcPriceFeed) returns() +func (_TBTCSystem *TBTCSystemSession) BeginEthBtcPriceFeedAddition(_ethBtcPriceFeed common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginEthBtcPriceFeedAddition(&_TBTCSystem.TransactOpts, _ethBtcPriceFeed) +} + +// BeginEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0x07a3d659. +// +// Solidity: function beginEthBtcPriceFeedAddition(address _ethBtcPriceFeed) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginEthBtcPriceFeedAddition(_ethBtcPriceFeed common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginEthBtcPriceFeedAddition(&_TBTCSystem.TransactOpts, _ethBtcPriceFeed) +} + +// BeginKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0xeae6191f. +// +// Solidity: function beginKeepFactoriesUpdate(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginKeepFactoriesUpdate(opts *bind.TransactOpts, _keepStakedFactory common.Address, _fullyBackedFactory common.Address, _factorySelector common.Address) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginKeepFactoriesUpdate", _keepStakedFactory, _fullyBackedFactory, _factorySelector) +} + +// BeginKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0xeae6191f. +// +// Solidity: function beginKeepFactoriesUpdate(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) returns() +func (_TBTCSystem *TBTCSystemSession) BeginKeepFactoriesUpdate(_keepStakedFactory common.Address, _fullyBackedFactory common.Address, _factorySelector common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginKeepFactoriesUpdate(&_TBTCSystem.TransactOpts, _keepStakedFactory, _fullyBackedFactory, _factorySelector) +} + +// BeginKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0xeae6191f. +// +// Solidity: function beginKeepFactoriesUpdate(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginKeepFactoriesUpdate(_keepStakedFactory common.Address, _fullyBackedFactory common.Address, _factorySelector common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginKeepFactoriesUpdate(&_TBTCSystem.TransactOpts, _keepStakedFactory, _fullyBackedFactory, _factorySelector) +} + +// BeginLotSizesUpdate is a paid mutator transaction binding the contract method 0x2b155e37. +// +// Solidity: function beginLotSizesUpdate(uint64[] _lotSizes) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginLotSizesUpdate(opts *bind.TransactOpts, _lotSizes []uint64) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginLotSizesUpdate", _lotSizes) +} + +// BeginLotSizesUpdate is a paid mutator transaction binding the contract method 0x2b155e37. +// +// Solidity: function beginLotSizesUpdate(uint64[] _lotSizes) returns() +func (_TBTCSystem *TBTCSystemSession) BeginLotSizesUpdate(_lotSizes []uint64) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginLotSizesUpdate(&_TBTCSystem.TransactOpts, _lotSizes) +} + +// BeginLotSizesUpdate is a paid mutator transaction binding the contract method 0x2b155e37. +// +// Solidity: function beginLotSizesUpdate(uint64[] _lotSizes) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginLotSizesUpdate(_lotSizes []uint64) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginLotSizesUpdate(&_TBTCSystem.TransactOpts, _lotSizes) +} + +// BeginSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x49b64730. +// +// Solidity: function beginSignerFeeDivisorUpdate(uint16 _signerFeeDivisor) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginSignerFeeDivisorUpdate(opts *bind.TransactOpts, _signerFeeDivisor uint16) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginSignerFeeDivisorUpdate", _signerFeeDivisor) +} + +// BeginSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x49b64730. +// +// Solidity: function beginSignerFeeDivisorUpdate(uint16 _signerFeeDivisor) returns() +func (_TBTCSystem *TBTCSystemSession) BeginSignerFeeDivisorUpdate(_signerFeeDivisor uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginSignerFeeDivisorUpdate(&_TBTCSystem.TransactOpts, _signerFeeDivisor) +} + +// BeginSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x49b64730. +// +// Solidity: function beginSignerFeeDivisorUpdate(uint16 _signerFeeDivisor) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginSignerFeeDivisorUpdate(_signerFeeDivisor uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginSignerFeeDivisorUpdate(&_TBTCSystem.TransactOpts, _signerFeeDivisor) +} + +// EmergencyPauseNewDeposits is a paid mutator transaction binding the contract method 0x80f04b8c. +// +// Solidity: function emergencyPauseNewDeposits() returns() +func (_TBTCSystem *TBTCSystemTransactor) EmergencyPauseNewDeposits(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "emergencyPauseNewDeposits") +} + +// EmergencyPauseNewDeposits is a paid mutator transaction binding the contract method 0x80f04b8c. +// +// Solidity: function emergencyPauseNewDeposits() returns() +func (_TBTCSystem *TBTCSystemSession) EmergencyPauseNewDeposits() (*types.Transaction, error) { + return _TBTCSystem.Contract.EmergencyPauseNewDeposits(&_TBTCSystem.TransactOpts) +} + +// EmergencyPauseNewDeposits is a paid mutator transaction binding the contract method 0x80f04b8c. +// +// Solidity: function emergencyPauseNewDeposits() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) EmergencyPauseNewDeposits() (*types.Transaction, error) { + return _TBTCSystem.Contract.EmergencyPauseNewDeposits(&_TBTCSystem.TransactOpts) +} + +// FinalizeCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xde1e57d0. +// +// Solidity: function finalizeCollateralizationThresholdsUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeCollateralizationThresholdsUpdate(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeCollateralizationThresholdsUpdate") +} + +// FinalizeCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xde1e57d0. +// +// Solidity: function finalizeCollateralizationThresholdsUpdate() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeCollateralizationThresholdsUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeCollateralizationThresholdsUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xde1e57d0. +// +// Solidity: function finalizeCollateralizationThresholdsUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeCollateralizationThresholdsUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeCollateralizationThresholdsUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0xadc3ef70. +// +// Solidity: function finalizeEthBtcPriceFeedAddition() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeEthBtcPriceFeedAddition(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeEthBtcPriceFeedAddition") +} + +// FinalizeEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0xadc3ef70. +// +// Solidity: function finalizeEthBtcPriceFeedAddition() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeEthBtcPriceFeedAddition() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeEthBtcPriceFeedAddition(&_TBTCSystem.TransactOpts) +} + +// FinalizeEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0xadc3ef70. +// +// Solidity: function finalizeEthBtcPriceFeedAddition() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeEthBtcPriceFeedAddition() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeEthBtcPriceFeedAddition(&_TBTCSystem.TransactOpts) +} + +// FinalizeKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0x0d4455dc. +// +// Solidity: function finalizeKeepFactoriesUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeKeepFactoriesUpdate(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeKeepFactoriesUpdate") +} + +// FinalizeKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0x0d4455dc. +// +// Solidity: function finalizeKeepFactoriesUpdate() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeKeepFactoriesUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeKeepFactoriesUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0x0d4455dc. +// +// Solidity: function finalizeKeepFactoriesUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeKeepFactoriesUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeKeepFactoriesUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeLotSizesUpdate is a paid mutator transaction binding the contract method 0xcd3a9490. +// +// Solidity: function finalizeLotSizesUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeLotSizesUpdate(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeLotSizesUpdate") +} + +// FinalizeLotSizesUpdate is a paid mutator transaction binding the contract method 0xcd3a9490. +// +// Solidity: function finalizeLotSizesUpdate() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeLotSizesUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeLotSizesUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeLotSizesUpdate is a paid mutator transaction binding the contract method 0xcd3a9490. +// +// Solidity: function finalizeLotSizesUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeLotSizesUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeLotSizesUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x0ce0e700. +// +// Solidity: function finalizeSignerFeeDivisorUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeSignerFeeDivisorUpdate(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeSignerFeeDivisorUpdate") +} + +// FinalizeSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x0ce0e700. +// +// Solidity: function finalizeSignerFeeDivisorUpdate() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeSignerFeeDivisorUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeSignerFeeDivisorUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x0ce0e700. +// +// Solidity: function finalizeSignerFeeDivisorUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeSignerFeeDivisorUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeSignerFeeDivisorUpdate(&_TBTCSystem.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1c52d90c. +// +// Solidity: function initialize(address _defaultKeepFactory, address _depositFactory, address _masterDepositAddress, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachine, uint16 _keepThreshold, uint16 _keepSize) returns() +func (_TBTCSystem *TBTCSystemTransactor) Initialize(opts *bind.TransactOpts, _defaultKeepFactory common.Address, _depositFactory common.Address, _masterDepositAddress common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachine common.Address, _keepThreshold uint16, _keepSize uint16) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "initialize", _defaultKeepFactory, _depositFactory, _masterDepositAddress, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachine, _keepThreshold, _keepSize) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1c52d90c. +// +// Solidity: function initialize(address _defaultKeepFactory, address _depositFactory, address _masterDepositAddress, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachine, uint16 _keepThreshold, uint16 _keepSize) returns() +func (_TBTCSystem *TBTCSystemSession) Initialize(_defaultKeepFactory common.Address, _depositFactory common.Address, _masterDepositAddress common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachine common.Address, _keepThreshold uint16, _keepSize uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.Initialize(&_TBTCSystem.TransactOpts, _defaultKeepFactory, _depositFactory, _masterDepositAddress, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachine, _keepThreshold, _keepSize) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1c52d90c. +// +// Solidity: function initialize(address _defaultKeepFactory, address _depositFactory, address _masterDepositAddress, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachine, uint16 _keepThreshold, uint16 _keepSize) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) Initialize(_defaultKeepFactory common.Address, _depositFactory common.Address, _masterDepositAddress common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachine common.Address, _keepThreshold uint16, _keepSize uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.Initialize(&_TBTCSystem.TransactOpts, _defaultKeepFactory, _depositFactory, _masterDepositAddress, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachine, _keepThreshold, _keepSize) +} + +// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. +// +// Solidity: function logCourtesyCalled() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogCourtesyCalled(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logCourtesyCalled") +} + +// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. +// +// Solidity: function logCourtesyCalled() returns() +func (_TBTCSystem *TBTCSystemSession) LogCourtesyCalled() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogCourtesyCalled(&_TBTCSystem.TransactOpts) +} + +// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. +// +// Solidity: function logCourtesyCalled() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogCourtesyCalled() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogCourtesyCalled(&_TBTCSystem.TransactOpts) +} + +// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. +// +// Solidity: function logCreated(address _keepAddress) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogCreated(opts *bind.TransactOpts, _keepAddress common.Address) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logCreated", _keepAddress) +} + +// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. +// +// Solidity: function logCreated(address _keepAddress) returns() +func (_TBTCSystem *TBTCSystemSession) LogCreated(_keepAddress common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogCreated(&_TBTCSystem.TransactOpts, _keepAddress) +} + +// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. +// +// Solidity: function logCreated(address _keepAddress) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogCreated(_keepAddress common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogCreated(&_TBTCSystem.TransactOpts, _keepAddress) +} + +// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. +// +// Solidity: function logExitedCourtesyCall() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogExitedCourtesyCall(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logExitedCourtesyCall") +} + +// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. +// +// Solidity: function logExitedCourtesyCall() returns() +func (_TBTCSystem *TBTCSystemSession) LogExitedCourtesyCall() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogExitedCourtesyCall(&_TBTCSystem.TransactOpts) +} + +// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. +// +// Solidity: function logExitedCourtesyCall() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogExitedCourtesyCall() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogExitedCourtesyCall(&_TBTCSystem.TransactOpts) +} + +// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. +// +// Solidity: function logFraudDuringSetup() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogFraudDuringSetup(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logFraudDuringSetup") +} + +// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. +// +// Solidity: function logFraudDuringSetup() returns() +func (_TBTCSystem *TBTCSystemSession) LogFraudDuringSetup() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFraudDuringSetup(&_TBTCSystem.TransactOpts) +} + +// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. +// +// Solidity: function logFraudDuringSetup() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogFraudDuringSetup() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFraudDuringSetup(&_TBTCSystem.TransactOpts) +} + +// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. +// +// Solidity: function logFunded(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogFunded(opts *bind.TransactOpts, _txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logFunded", _txid) +} + +// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. +// +// Solidity: function logFunded(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemSession) LogFunded(_txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFunded(&_TBTCSystem.TransactOpts, _txid) +} + +// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. +// +// Solidity: function logFunded(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogFunded(_txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFunded(&_TBTCSystem.TransactOpts, _txid) +} + +// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. +// +// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogFunderRequestedAbort(opts *bind.TransactOpts, _abortOutputScript []byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logFunderRequestedAbort", _abortOutputScript) +} + +// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. +// +// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() +func (_TBTCSystem *TBTCSystemSession) LogFunderRequestedAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFunderRequestedAbort(&_TBTCSystem.TransactOpts, _abortOutputScript) +} + +// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. +// +// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogFunderRequestedAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFunderRequestedAbort(&_TBTCSystem.TransactOpts, _abortOutputScript) +} + +// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. +// +// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogGotRedemptionSignature(opts *bind.TransactOpts, _digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logGotRedemptionSignature", _digest, _r, _s) +} + +// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. +// +// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() +func (_TBTCSystem *TBTCSystemSession) LogGotRedemptionSignature(_digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogGotRedemptionSignature(&_TBTCSystem.TransactOpts, _digest, _r, _s) +} + +// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. +// +// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogGotRedemptionSignature(_digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogGotRedemptionSignature(&_TBTCSystem.TransactOpts, _digest, _r, _s) +} + +// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. +// +// Solidity: function logLiquidated() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogLiquidated(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logLiquidated") +} + +// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. +// +// Solidity: function logLiquidated() returns() +func (_TBTCSystem *TBTCSystemSession) LogLiquidated() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogLiquidated(&_TBTCSystem.TransactOpts) +} + +// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. +// +// Solidity: function logLiquidated() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogLiquidated() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogLiquidated(&_TBTCSystem.TransactOpts) +} + +// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. +// +// Solidity: function logRedeemed(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogRedeemed(opts *bind.TransactOpts, _txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logRedeemed", _txid) +} + +// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. +// +// Solidity: function logRedeemed(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemSession) LogRedeemed(_txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRedeemed(&_TBTCSystem.TransactOpts, _txid) +} + +// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. +// +// Solidity: function logRedeemed(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogRedeemed(_txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRedeemed(&_TBTCSystem.TransactOpts, _txid) +} + +// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. +// +// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogRedemptionRequested(opts *bind.TransactOpts, _requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logRedemptionRequested", _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) +} + +// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. +// +// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() +func (_TBTCSystem *TBTCSystemSession) LogRedemptionRequested(_requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRedemptionRequested(&_TBTCSystem.TransactOpts, _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) +} + +// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. +// +// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogRedemptionRequested(_requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRedemptionRequested(&_TBTCSystem.TransactOpts, _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) +} + +// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. +// +// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogRegisteredPubkey(opts *bind.TransactOpts, _signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logRegisteredPubkey", _signingGroupPubkeyX, _signingGroupPubkeyY) +} + +// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. +// +// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() +func (_TBTCSystem *TBTCSystemSession) LogRegisteredPubkey(_signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRegisteredPubkey(&_TBTCSystem.TransactOpts, _signingGroupPubkeyX, _signingGroupPubkeyY) +} + +// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. +// +// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogRegisteredPubkey(_signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRegisteredPubkey(&_TBTCSystem.TransactOpts, _signingGroupPubkeyX, _signingGroupPubkeyY) +} + +// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. +// +// Solidity: function logSetupFailed() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogSetupFailed(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logSetupFailed") +} + +// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. +// +// Solidity: function logSetupFailed() returns() +func (_TBTCSystem *TBTCSystemSession) LogSetupFailed() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogSetupFailed(&_TBTCSystem.TransactOpts) +} + +// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. +// +// Solidity: function logSetupFailed() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogSetupFailed() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogSetupFailed(&_TBTCSystem.TransactOpts) +} + +// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. +// +// Solidity: function logStartedLiquidation(bool _wasFraud) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogStartedLiquidation(opts *bind.TransactOpts, _wasFraud bool) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logStartedLiquidation", _wasFraud) +} + +// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. +// +// Solidity: function logStartedLiquidation(bool _wasFraud) returns() +func (_TBTCSystem *TBTCSystemSession) LogStartedLiquidation(_wasFraud bool) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogStartedLiquidation(&_TBTCSystem.TransactOpts, _wasFraud) +} + +// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. +// +// Solidity: function logStartedLiquidation(bool _wasFraud) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogStartedLiquidation(_wasFraud bool) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogStartedLiquidation(&_TBTCSystem.TransactOpts, _wasFraud) +} + +// RefreshMinimumBondableValue is a paid mutator transaction binding the contract method 0x7c75b115. +// +// Solidity: function refreshMinimumBondableValue() returns() +func (_TBTCSystem *TBTCSystemTransactor) RefreshMinimumBondableValue(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "refreshMinimumBondableValue") +} + +// RefreshMinimumBondableValue is a paid mutator transaction binding the contract method 0x7c75b115. +// +// Solidity: function refreshMinimumBondableValue() returns() +func (_TBTCSystem *TBTCSystemSession) RefreshMinimumBondableValue() (*types.Transaction, error) { + return _TBTCSystem.Contract.RefreshMinimumBondableValue(&_TBTCSystem.TransactOpts) +} + +// RefreshMinimumBondableValue is a paid mutator transaction binding the contract method 0x7c75b115. +// +// Solidity: function refreshMinimumBondableValue() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) RefreshMinimumBondableValue() (*types.Transaction, error) { + return _TBTCSystem.Contract.RefreshMinimumBondableValue(&_TBTCSystem.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TBTCSystem *TBTCSystemTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TBTCSystem *TBTCSystemSession) RenounceOwnership() (*types.Transaction, error) { + return _TBTCSystem.Contract.RenounceOwnership(&_TBTCSystem.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _TBTCSystem.Contract.RenounceOwnership(&_TBTCSystem.TransactOpts) +} + +// RequestNewKeep is a paid mutator transaction binding the contract method 0x82f91968. +// +// Solidity: function requestNewKeep(uint64 _requestedLotSizeSatoshis, uint256 _maxSecuredLifetime) returns(address) +func (_TBTCSystem *TBTCSystemTransactor) RequestNewKeep(opts *bind.TransactOpts, _requestedLotSizeSatoshis uint64, _maxSecuredLifetime *big.Int) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "requestNewKeep", _requestedLotSizeSatoshis, _maxSecuredLifetime) +} + +// RequestNewKeep is a paid mutator transaction binding the contract method 0x82f91968. +// +// Solidity: function requestNewKeep(uint64 _requestedLotSizeSatoshis, uint256 _maxSecuredLifetime) returns(address) +func (_TBTCSystem *TBTCSystemSession) RequestNewKeep(_requestedLotSizeSatoshis uint64, _maxSecuredLifetime *big.Int) (*types.Transaction, error) { + return _TBTCSystem.Contract.RequestNewKeep(&_TBTCSystem.TransactOpts, _requestedLotSizeSatoshis, _maxSecuredLifetime) +} + +// RequestNewKeep is a paid mutator transaction binding the contract method 0x82f91968. +// +// Solidity: function requestNewKeep(uint64 _requestedLotSizeSatoshis, uint256 _maxSecuredLifetime) returns(address) +func (_TBTCSystem *TBTCSystemTransactorSession) RequestNewKeep(_requestedLotSizeSatoshis uint64, _maxSecuredLifetime *big.Int) (*types.Transaction, error) { + return _TBTCSystem.Contract.RequestNewKeep(&_TBTCSystem.TransactOpts, _requestedLotSizeSatoshis, _maxSecuredLifetime) +} + +// ResumeNewDeposits is a paid mutator transaction binding the contract method 0x7c33fc05. +// +// Solidity: function resumeNewDeposits() returns() +func (_TBTCSystem *TBTCSystemTransactor) ResumeNewDeposits(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "resumeNewDeposits") +} + +// ResumeNewDeposits is a paid mutator transaction binding the contract method 0x7c33fc05. +// +// Solidity: function resumeNewDeposits() returns() +func (_TBTCSystem *TBTCSystemSession) ResumeNewDeposits() (*types.Transaction, error) { + return _TBTCSystem.Contract.ResumeNewDeposits(&_TBTCSystem.TransactOpts) +} + +// ResumeNewDeposits is a paid mutator transaction binding the contract method 0x7c33fc05. +// +// Solidity: function resumeNewDeposits() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) ResumeNewDeposits() (*types.Transaction, error) { + return _TBTCSystem.Contract.ResumeNewDeposits(&_TBTCSystem.TransactOpts) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TBTCSystem *TBTCSystemTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TBTCSystem *TBTCSystemSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.TransferOwnership(&_TBTCSystem.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.TransferOwnership(&_TBTCSystem.TransactOpts, newOwner) +} + +// TBTCSystemAllowNewDepositsUpdatedIterator is returned from FilterAllowNewDepositsUpdated and is used to iterate over the raw logs and unpacked data for AllowNewDepositsUpdated events raised by the TBTCSystem contract. +type TBTCSystemAllowNewDepositsUpdatedIterator struct { + Event *TBTCSystemAllowNewDepositsUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemAllowNewDepositsUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemAllowNewDepositsUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemAllowNewDepositsUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemAllowNewDepositsUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemAllowNewDepositsUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemAllowNewDepositsUpdated represents a AllowNewDepositsUpdated event raised by the TBTCSystem contract. +type TBTCSystemAllowNewDepositsUpdated struct { + AllowNewDeposits bool + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAllowNewDepositsUpdated is a free log retrieval operation binding the contract event 0x3a854be74be62dd3ba5f0fdb7aa5b535683f999e90cda09ba75a2d99b2722523. +// +// Solidity: event AllowNewDepositsUpdated(bool _allowNewDeposits) +func (_TBTCSystem *TBTCSystemFilterer) FilterAllowNewDepositsUpdated(opts *bind.FilterOpts) (*TBTCSystemAllowNewDepositsUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "AllowNewDepositsUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemAllowNewDepositsUpdatedIterator{contract: _TBTCSystem.contract, event: "AllowNewDepositsUpdated", logs: logs, sub: sub}, nil +} + +// WatchAllowNewDepositsUpdated is a free log subscription operation binding the contract event 0x3a854be74be62dd3ba5f0fdb7aa5b535683f999e90cda09ba75a2d99b2722523. +// +// Solidity: event AllowNewDepositsUpdated(bool _allowNewDeposits) +func (_TBTCSystem *TBTCSystemFilterer) WatchAllowNewDepositsUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemAllowNewDepositsUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "AllowNewDepositsUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemAllowNewDepositsUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "AllowNewDepositsUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAllowNewDepositsUpdated is a log parse operation binding the contract event 0x3a854be74be62dd3ba5f0fdb7aa5b535683f999e90cda09ba75a2d99b2722523. +// +// Solidity: event AllowNewDepositsUpdated(bool _allowNewDeposits) +func (_TBTCSystem *TBTCSystemFilterer) ParseAllowNewDepositsUpdated(log types.Log) (*TBTCSystemAllowNewDepositsUpdated, error) { + event := new(TBTCSystemAllowNewDepositsUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "AllowNewDepositsUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemCollateralizationThresholdsUpdateStartedIterator is returned from FilterCollateralizationThresholdsUpdateStarted and is used to iterate over the raw logs and unpacked data for CollateralizationThresholdsUpdateStarted events raised by the TBTCSystem contract. +type TBTCSystemCollateralizationThresholdsUpdateStartedIterator struct { + Event *TBTCSystemCollateralizationThresholdsUpdateStarted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemCollateralizationThresholdsUpdateStartedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemCollateralizationThresholdsUpdateStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemCollateralizationThresholdsUpdateStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemCollateralizationThresholdsUpdateStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemCollateralizationThresholdsUpdateStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemCollateralizationThresholdsUpdateStarted represents a CollateralizationThresholdsUpdateStarted event raised by the TBTCSystem contract. +type TBTCSystemCollateralizationThresholdsUpdateStarted struct { + InitialCollateralizedPercent uint16 + UndercollateralizedThresholdPercent uint16 + SeverelyUndercollateralizedThresholdPercent uint16 + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCollateralizationThresholdsUpdateStarted is a free log retrieval operation binding the contract event 0xc9e225c2db3e9f70966e6c0403de785bcda0172ec4e41111a6e8f4b85b1f30fb. +// +// Solidity: event CollateralizationThresholdsUpdateStarted(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterCollateralizationThresholdsUpdateStarted(opts *bind.FilterOpts) (*TBTCSystemCollateralizationThresholdsUpdateStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "CollateralizationThresholdsUpdateStarted") + if err != nil { + return nil, err + } + return &TBTCSystemCollateralizationThresholdsUpdateStartedIterator{contract: _TBTCSystem.contract, event: "CollateralizationThresholdsUpdateStarted", logs: logs, sub: sub}, nil +} + +// WatchCollateralizationThresholdsUpdateStarted is a free log subscription operation binding the contract event 0xc9e225c2db3e9f70966e6c0403de785bcda0172ec4e41111a6e8f4b85b1f30fb. +// +// Solidity: event CollateralizationThresholdsUpdateStarted(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchCollateralizationThresholdsUpdateStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemCollateralizationThresholdsUpdateStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "CollateralizationThresholdsUpdateStarted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemCollateralizationThresholdsUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "CollateralizationThresholdsUpdateStarted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseCollateralizationThresholdsUpdateStarted is a log parse operation binding the contract event 0xc9e225c2db3e9f70966e6c0403de785bcda0172ec4e41111a6e8f4b85b1f30fb. +// +// Solidity: event CollateralizationThresholdsUpdateStarted(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseCollateralizationThresholdsUpdateStarted(log types.Log) (*TBTCSystemCollateralizationThresholdsUpdateStarted, error) { + event := new(TBTCSystemCollateralizationThresholdsUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "CollateralizationThresholdsUpdateStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemCollateralizationThresholdsUpdatedIterator is returned from FilterCollateralizationThresholdsUpdated and is used to iterate over the raw logs and unpacked data for CollateralizationThresholdsUpdated events raised by the TBTCSystem contract. +type TBTCSystemCollateralizationThresholdsUpdatedIterator struct { + Event *TBTCSystemCollateralizationThresholdsUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemCollateralizationThresholdsUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemCollateralizationThresholdsUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemCollateralizationThresholdsUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemCollateralizationThresholdsUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemCollateralizationThresholdsUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemCollateralizationThresholdsUpdated represents a CollateralizationThresholdsUpdated event raised by the TBTCSystem contract. +type TBTCSystemCollateralizationThresholdsUpdated struct { + InitialCollateralizedPercent uint16 + UndercollateralizedThresholdPercent uint16 + SeverelyUndercollateralizedThresholdPercent uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCollateralizationThresholdsUpdated is a free log retrieval operation binding the contract event 0x07ac9ce7dc4b2edb6435fb2255e9e867f357ef2052b982ce468442aa9d6c1d50. +// +// Solidity: event CollateralizationThresholdsUpdated(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) +func (_TBTCSystem *TBTCSystemFilterer) FilterCollateralizationThresholdsUpdated(opts *bind.FilterOpts) (*TBTCSystemCollateralizationThresholdsUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "CollateralizationThresholdsUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemCollateralizationThresholdsUpdatedIterator{contract: _TBTCSystem.contract, event: "CollateralizationThresholdsUpdated", logs: logs, sub: sub}, nil +} + +// WatchCollateralizationThresholdsUpdated is a free log subscription operation binding the contract event 0x07ac9ce7dc4b2edb6435fb2255e9e867f357ef2052b982ce468442aa9d6c1d50. +// +// Solidity: event CollateralizationThresholdsUpdated(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) +func (_TBTCSystem *TBTCSystemFilterer) WatchCollateralizationThresholdsUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemCollateralizationThresholdsUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "CollateralizationThresholdsUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemCollateralizationThresholdsUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "CollateralizationThresholdsUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseCollateralizationThresholdsUpdated is a log parse operation binding the contract event 0x07ac9ce7dc4b2edb6435fb2255e9e867f357ef2052b982ce468442aa9d6c1d50. +// +// Solidity: event CollateralizationThresholdsUpdated(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) +func (_TBTCSystem *TBTCSystemFilterer) ParseCollateralizationThresholdsUpdated(log types.Log) (*TBTCSystemCollateralizationThresholdsUpdated, error) { + event := new(TBTCSystemCollateralizationThresholdsUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "CollateralizationThresholdsUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemCourtesyCalledIterator is returned from FilterCourtesyCalled and is used to iterate over the raw logs and unpacked data for CourtesyCalled events raised by the TBTCSystem contract. +type TBTCSystemCourtesyCalledIterator struct { + Event *TBTCSystemCourtesyCalled // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemCourtesyCalledIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemCourtesyCalled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemCourtesyCalled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemCourtesyCalledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemCourtesyCalledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemCourtesyCalled represents a CourtesyCalled event raised by the TBTCSystem contract. +type TBTCSystemCourtesyCalled struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCourtesyCalled is a free log retrieval operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. +// +// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterCourtesyCalled(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemCourtesyCalledIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "CourtesyCalled", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemCourtesyCalledIterator{contract: _TBTCSystem.contract, event: "CourtesyCalled", logs: logs, sub: sub}, nil +} + +// WatchCourtesyCalled is a free log subscription operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. +// +// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchCourtesyCalled(opts *bind.WatchOpts, sink chan<- *TBTCSystemCourtesyCalled, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "CourtesyCalled", _depositContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemCourtesyCalled) + if err := _TBTCSystem.contract.UnpackLog(event, "CourtesyCalled", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseCourtesyCalled is a log parse operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. +// +// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseCourtesyCalled(log types.Log) (*TBTCSystemCourtesyCalled, error) { + event := new(TBTCSystemCourtesyCalled) + if err := _TBTCSystem.contract.UnpackLog(event, "CourtesyCalled", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemCreatedIterator is returned from FilterCreated and is used to iterate over the raw logs and unpacked data for Created events raised by the TBTCSystem contract. +type TBTCSystemCreatedIterator struct { + Event *TBTCSystemCreated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemCreatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemCreated represents a Created event raised by the TBTCSystem contract. +type TBTCSystemCreated struct { + DepositContractAddress common.Address + KeepAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCreated is a free log retrieval operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. +// +// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterCreated(opts *bind.FilterOpts, _depositContractAddress []common.Address, _keepAddress []common.Address) (*TBTCSystemCreatedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _keepAddressRule []interface{} + for _, _keepAddressItem := range _keepAddress { + _keepAddressRule = append(_keepAddressRule, _keepAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "Created", _depositContractAddressRule, _keepAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemCreatedIterator{contract: _TBTCSystem.contract, event: "Created", logs: logs, sub: sub}, nil +} + +// WatchCreated is a free log subscription operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. +// +// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchCreated(opts *bind.WatchOpts, sink chan<- *TBTCSystemCreated, _depositContractAddress []common.Address, _keepAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _keepAddressRule []interface{} + for _, _keepAddressItem := range _keepAddress { + _keepAddressRule = append(_keepAddressRule, _keepAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "Created", _depositContractAddressRule, _keepAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemCreated) + if err := _TBTCSystem.contract.UnpackLog(event, "Created", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseCreated is a log parse operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. +// +// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseCreated(log types.Log) (*TBTCSystemCreated, error) { + event := new(TBTCSystemCreated) + if err := _TBTCSystem.contract.UnpackLog(event, "Created", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemEthBtcPriceFeedAddedIterator is returned from FilterEthBtcPriceFeedAdded and is used to iterate over the raw logs and unpacked data for EthBtcPriceFeedAdded events raised by the TBTCSystem contract. +type TBTCSystemEthBtcPriceFeedAddedIterator struct { + Event *TBTCSystemEthBtcPriceFeedAdded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemEthBtcPriceFeedAddedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemEthBtcPriceFeedAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemEthBtcPriceFeedAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemEthBtcPriceFeedAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemEthBtcPriceFeedAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemEthBtcPriceFeedAdded represents a EthBtcPriceFeedAdded event raised by the TBTCSystem contract. +type TBTCSystemEthBtcPriceFeedAdded struct { + PriceFeed common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEthBtcPriceFeedAdded is a free log retrieval operation binding the contract event 0x5e4bd1f6e413d39e172d96a88ee6b1b2ba9e1a6207e2ca34fa8c3ccd152ff21a. +// +// Solidity: event EthBtcPriceFeedAdded(address _priceFeed) +func (_TBTCSystem *TBTCSystemFilterer) FilterEthBtcPriceFeedAdded(opts *bind.FilterOpts) (*TBTCSystemEthBtcPriceFeedAddedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "EthBtcPriceFeedAdded") + if err != nil { + return nil, err + } + return &TBTCSystemEthBtcPriceFeedAddedIterator{contract: _TBTCSystem.contract, event: "EthBtcPriceFeedAdded", logs: logs, sub: sub}, nil +} + +// WatchEthBtcPriceFeedAdded is a free log subscription operation binding the contract event 0x5e4bd1f6e413d39e172d96a88ee6b1b2ba9e1a6207e2ca34fa8c3ccd152ff21a. +// +// Solidity: event EthBtcPriceFeedAdded(address _priceFeed) +func (_TBTCSystem *TBTCSystemFilterer) WatchEthBtcPriceFeedAdded(opts *bind.WatchOpts, sink chan<- *TBTCSystemEthBtcPriceFeedAdded) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "EthBtcPriceFeedAdded") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemEthBtcPriceFeedAdded) + if err := _TBTCSystem.contract.UnpackLog(event, "EthBtcPriceFeedAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEthBtcPriceFeedAdded is a log parse operation binding the contract event 0x5e4bd1f6e413d39e172d96a88ee6b1b2ba9e1a6207e2ca34fa8c3ccd152ff21a. +// +// Solidity: event EthBtcPriceFeedAdded(address _priceFeed) +func (_TBTCSystem *TBTCSystemFilterer) ParseEthBtcPriceFeedAdded(log types.Log) (*TBTCSystemEthBtcPriceFeedAdded, error) { + event := new(TBTCSystemEthBtcPriceFeedAdded) + if err := _TBTCSystem.contract.UnpackLog(event, "EthBtcPriceFeedAdded", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemEthBtcPriceFeedAdditionStartedIterator is returned from FilterEthBtcPriceFeedAdditionStarted and is used to iterate over the raw logs and unpacked data for EthBtcPriceFeedAdditionStarted events raised by the TBTCSystem contract. +type TBTCSystemEthBtcPriceFeedAdditionStartedIterator struct { + Event *TBTCSystemEthBtcPriceFeedAdditionStarted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemEthBtcPriceFeedAdditionStartedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemEthBtcPriceFeedAdditionStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemEthBtcPriceFeedAdditionStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemEthBtcPriceFeedAdditionStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemEthBtcPriceFeedAdditionStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemEthBtcPriceFeedAdditionStarted represents a EthBtcPriceFeedAdditionStarted event raised by the TBTCSystem contract. +type TBTCSystemEthBtcPriceFeedAdditionStarted struct { + PriceFeed common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEthBtcPriceFeedAdditionStarted is a free log retrieval operation binding the contract event 0x5a3d3d9197f5c60c16de28887dccf83284a4fd034b930272637c83307b4fffe7. +// +// Solidity: event EthBtcPriceFeedAdditionStarted(address _priceFeed, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterEthBtcPriceFeedAdditionStarted(opts *bind.FilterOpts) (*TBTCSystemEthBtcPriceFeedAdditionStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "EthBtcPriceFeedAdditionStarted") + if err != nil { + return nil, err + } + return &TBTCSystemEthBtcPriceFeedAdditionStartedIterator{contract: _TBTCSystem.contract, event: "EthBtcPriceFeedAdditionStarted", logs: logs, sub: sub}, nil +} + +// WatchEthBtcPriceFeedAdditionStarted is a free log subscription operation binding the contract event 0x5a3d3d9197f5c60c16de28887dccf83284a4fd034b930272637c83307b4fffe7. +// +// Solidity: event EthBtcPriceFeedAdditionStarted(address _priceFeed, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchEthBtcPriceFeedAdditionStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemEthBtcPriceFeedAdditionStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "EthBtcPriceFeedAdditionStarted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemEthBtcPriceFeedAdditionStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "EthBtcPriceFeedAdditionStarted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEthBtcPriceFeedAdditionStarted is a log parse operation binding the contract event 0x5a3d3d9197f5c60c16de28887dccf83284a4fd034b930272637c83307b4fffe7. +// +// Solidity: event EthBtcPriceFeedAdditionStarted(address _priceFeed, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseEthBtcPriceFeedAdditionStarted(log types.Log) (*TBTCSystemEthBtcPriceFeedAdditionStarted, error) { + event := new(TBTCSystemEthBtcPriceFeedAdditionStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "EthBtcPriceFeedAdditionStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemExitedCourtesyCallIterator is returned from FilterExitedCourtesyCall and is used to iterate over the raw logs and unpacked data for ExitedCourtesyCall events raised by the TBTCSystem contract. +type TBTCSystemExitedCourtesyCallIterator struct { + Event *TBTCSystemExitedCourtesyCall // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemExitedCourtesyCallIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemExitedCourtesyCall) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemExitedCourtesyCall) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemExitedCourtesyCallIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemExitedCourtesyCallIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemExitedCourtesyCall represents a ExitedCourtesyCall event raised by the TBTCSystem contract. +type TBTCSystemExitedCourtesyCall struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExitedCourtesyCall is a free log retrieval operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. +// +// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterExitedCourtesyCall(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemExitedCourtesyCallIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "ExitedCourtesyCall", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemExitedCourtesyCallIterator{contract: _TBTCSystem.contract, event: "ExitedCourtesyCall", logs: logs, sub: sub}, nil +} + +// WatchExitedCourtesyCall is a free log subscription operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. +// +// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchExitedCourtesyCall(opts *bind.WatchOpts, sink chan<- *TBTCSystemExitedCourtesyCall, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "ExitedCourtesyCall", _depositContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemExitedCourtesyCall) + if err := _TBTCSystem.contract.UnpackLog(event, "ExitedCourtesyCall", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseExitedCourtesyCall is a log parse operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. +// +// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseExitedCourtesyCall(log types.Log) (*TBTCSystemExitedCourtesyCall, error) { + event := new(TBTCSystemExitedCourtesyCall) + if err := _TBTCSystem.contract.UnpackLog(event, "ExitedCourtesyCall", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemFraudDuringSetupIterator is returned from FilterFraudDuringSetup and is used to iterate over the raw logs and unpacked data for FraudDuringSetup events raised by the TBTCSystem contract. +type TBTCSystemFraudDuringSetupIterator struct { + Event *TBTCSystemFraudDuringSetup // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemFraudDuringSetupIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemFraudDuringSetup) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemFraudDuringSetup) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemFraudDuringSetupIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemFraudDuringSetupIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemFraudDuringSetup represents a FraudDuringSetup event raised by the TBTCSystem contract. +type TBTCSystemFraudDuringSetup struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFraudDuringSetup is a free log retrieval operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. +// +// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterFraudDuringSetup(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemFraudDuringSetupIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "FraudDuringSetup", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemFraudDuringSetupIterator{contract: _TBTCSystem.contract, event: "FraudDuringSetup", logs: logs, sub: sub}, nil +} + +// WatchFraudDuringSetup is a free log subscription operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. +// +// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchFraudDuringSetup(opts *bind.WatchOpts, sink chan<- *TBTCSystemFraudDuringSetup, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "FraudDuringSetup", _depositContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemFraudDuringSetup) + if err := _TBTCSystem.contract.UnpackLog(event, "FraudDuringSetup", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseFraudDuringSetup is a log parse operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. +// +// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseFraudDuringSetup(log types.Log) (*TBTCSystemFraudDuringSetup, error) { + event := new(TBTCSystemFraudDuringSetup) + if err := _TBTCSystem.contract.UnpackLog(event, "FraudDuringSetup", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemFundedIterator is returned from FilterFunded and is used to iterate over the raw logs and unpacked data for Funded events raised by the TBTCSystem contract. +type TBTCSystemFundedIterator struct { + Event *TBTCSystemFunded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemFundedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemFunded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemFunded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemFundedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemFundedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemFunded represents a Funded event raised by the TBTCSystem contract. +type TBTCSystemFunded struct { + DepositContractAddress common.Address + Txid [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFunded is a free log retrieval operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. +// +// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterFunded(opts *bind.FilterOpts, _depositContractAddress []common.Address, _txid [][32]byte) (*TBTCSystemFundedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "Funded", _depositContractAddressRule, _txidRule) + if err != nil { + return nil, err + } + return &TBTCSystemFundedIterator{contract: _TBTCSystem.contract, event: "Funded", logs: logs, sub: sub}, nil +} + +// WatchFunded is a free log subscription operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. +// +// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchFunded(opts *bind.WatchOpts, sink chan<- *TBTCSystemFunded, _depositContractAddress []common.Address, _txid [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "Funded", _depositContractAddressRule, _txidRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemFunded) + if err := _TBTCSystem.contract.UnpackLog(event, "Funded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseFunded is a log parse operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. +// +// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseFunded(log types.Log) (*TBTCSystemFunded, error) { + event := new(TBTCSystemFunded) + if err := _TBTCSystem.contract.UnpackLog(event, "Funded", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemFunderAbortRequestedIterator is returned from FilterFunderAbortRequested and is used to iterate over the raw logs and unpacked data for FunderAbortRequested events raised by the TBTCSystem contract. +type TBTCSystemFunderAbortRequestedIterator struct { + Event *TBTCSystemFunderAbortRequested // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemFunderAbortRequestedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemFunderAbortRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemFunderAbortRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemFunderAbortRequestedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemFunderAbortRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemFunderAbortRequested represents a FunderAbortRequested event raised by the TBTCSystem contract. +type TBTCSystemFunderAbortRequested struct { + DepositContractAddress common.Address + AbortOutputScript []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFunderAbortRequested is a free log retrieval operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. +// +// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) +func (_TBTCSystem *TBTCSystemFilterer) FilterFunderAbortRequested(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemFunderAbortRequestedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "FunderAbortRequested", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemFunderAbortRequestedIterator{contract: _TBTCSystem.contract, event: "FunderAbortRequested", logs: logs, sub: sub}, nil +} + +// WatchFunderAbortRequested is a free log subscription operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. +// +// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) +func (_TBTCSystem *TBTCSystemFilterer) WatchFunderAbortRequested(opts *bind.WatchOpts, sink chan<- *TBTCSystemFunderAbortRequested, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "FunderAbortRequested", _depositContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemFunderAbortRequested) + if err := _TBTCSystem.contract.UnpackLog(event, "FunderAbortRequested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseFunderAbortRequested is a log parse operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. +// +// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) +func (_TBTCSystem *TBTCSystemFilterer) ParseFunderAbortRequested(log types.Log) (*TBTCSystemFunderAbortRequested, error) { + event := new(TBTCSystemFunderAbortRequested) + if err := _TBTCSystem.contract.UnpackLog(event, "FunderAbortRequested", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemGotRedemptionSignatureIterator is returned from FilterGotRedemptionSignature and is used to iterate over the raw logs and unpacked data for GotRedemptionSignature events raised by the TBTCSystem contract. +type TBTCSystemGotRedemptionSignatureIterator struct { + Event *TBTCSystemGotRedemptionSignature // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemGotRedemptionSignatureIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemGotRedemptionSignature) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemGotRedemptionSignature) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemGotRedemptionSignatureIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemGotRedemptionSignatureIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemGotRedemptionSignature represents a GotRedemptionSignature event raised by the TBTCSystem contract. +type TBTCSystemGotRedemptionSignature struct { + DepositContractAddress common.Address + Digest [32]byte + R [32]byte + S [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterGotRedemptionSignature is a free log retrieval operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. +// +// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterGotRedemptionSignature(opts *bind.FilterOpts, _depositContractAddress []common.Address, _digest [][32]byte) (*TBTCSystemGotRedemptionSignatureIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "GotRedemptionSignature", _depositContractAddressRule, _digestRule) + if err != nil { + return nil, err + } + return &TBTCSystemGotRedemptionSignatureIterator{contract: _TBTCSystem.contract, event: "GotRedemptionSignature", logs: logs, sub: sub}, nil +} + +// WatchGotRedemptionSignature is a free log subscription operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. +// +// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchGotRedemptionSignature(opts *bind.WatchOpts, sink chan<- *TBTCSystemGotRedemptionSignature, _depositContractAddress []common.Address, _digest [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "GotRedemptionSignature", _depositContractAddressRule, _digestRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemGotRedemptionSignature) + if err := _TBTCSystem.contract.UnpackLog(event, "GotRedemptionSignature", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseGotRedemptionSignature is a log parse operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. +// +// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseGotRedemptionSignature(log types.Log) (*TBTCSystemGotRedemptionSignature, error) { + event := new(TBTCSystemGotRedemptionSignature) + if err := _TBTCSystem.contract.UnpackLog(event, "GotRedemptionSignature", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemKeepFactoriesUpdateStartedIterator is returned from FilterKeepFactoriesUpdateStarted and is used to iterate over the raw logs and unpacked data for KeepFactoriesUpdateStarted events raised by the TBTCSystem contract. +type TBTCSystemKeepFactoriesUpdateStartedIterator struct { + Event *TBTCSystemKeepFactoriesUpdateStarted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemKeepFactoriesUpdateStartedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemKeepFactoriesUpdateStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemKeepFactoriesUpdateStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemKeepFactoriesUpdateStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemKeepFactoriesUpdateStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemKeepFactoriesUpdateStarted represents a KeepFactoriesUpdateStarted event raised by the TBTCSystem contract. +type TBTCSystemKeepFactoriesUpdateStarted struct { + KeepStakedFactory common.Address + FullyBackedFactory common.Address + FactorySelector common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterKeepFactoriesUpdateStarted is a free log retrieval operation binding the contract event 0x1608ec8025d64cdb0ed78e62a67d271a33b9d738842a6eb6e6449bc3afab6dca. +// +// Solidity: event KeepFactoriesUpdateStarted(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterKeepFactoriesUpdateStarted(opts *bind.FilterOpts) (*TBTCSystemKeepFactoriesUpdateStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "KeepFactoriesUpdateStarted") + if err != nil { + return nil, err + } + return &TBTCSystemKeepFactoriesUpdateStartedIterator{contract: _TBTCSystem.contract, event: "KeepFactoriesUpdateStarted", logs: logs, sub: sub}, nil +} + +// WatchKeepFactoriesUpdateStarted is a free log subscription operation binding the contract event 0x1608ec8025d64cdb0ed78e62a67d271a33b9d738842a6eb6e6449bc3afab6dca. +// +// Solidity: event KeepFactoriesUpdateStarted(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchKeepFactoriesUpdateStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemKeepFactoriesUpdateStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "KeepFactoriesUpdateStarted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemKeepFactoriesUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "KeepFactoriesUpdateStarted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseKeepFactoriesUpdateStarted is a log parse operation binding the contract event 0x1608ec8025d64cdb0ed78e62a67d271a33b9d738842a6eb6e6449bc3afab6dca. +// +// Solidity: event KeepFactoriesUpdateStarted(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseKeepFactoriesUpdateStarted(log types.Log) (*TBTCSystemKeepFactoriesUpdateStarted, error) { + event := new(TBTCSystemKeepFactoriesUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "KeepFactoriesUpdateStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemKeepFactoriesUpdatedIterator is returned from FilterKeepFactoriesUpdated and is used to iterate over the raw logs and unpacked data for KeepFactoriesUpdated events raised by the TBTCSystem contract. +type TBTCSystemKeepFactoriesUpdatedIterator struct { + Event *TBTCSystemKeepFactoriesUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemKeepFactoriesUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemKeepFactoriesUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemKeepFactoriesUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemKeepFactoriesUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemKeepFactoriesUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemKeepFactoriesUpdated represents a KeepFactoriesUpdated event raised by the TBTCSystem contract. +type TBTCSystemKeepFactoriesUpdated struct { + KeepStakedFactory common.Address + FullyBackedFactory common.Address + FactorySelector common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterKeepFactoriesUpdated is a free log retrieval operation binding the contract event 0x75cd06e2a95bd62ad447184bf0950b3af3aabd0960994d09da9724686d0c1720. +// +// Solidity: event KeepFactoriesUpdated(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) +func (_TBTCSystem *TBTCSystemFilterer) FilterKeepFactoriesUpdated(opts *bind.FilterOpts) (*TBTCSystemKeepFactoriesUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "KeepFactoriesUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemKeepFactoriesUpdatedIterator{contract: _TBTCSystem.contract, event: "KeepFactoriesUpdated", logs: logs, sub: sub}, nil +} + +// WatchKeepFactoriesUpdated is a free log subscription operation binding the contract event 0x75cd06e2a95bd62ad447184bf0950b3af3aabd0960994d09da9724686d0c1720. +// +// Solidity: event KeepFactoriesUpdated(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) +func (_TBTCSystem *TBTCSystemFilterer) WatchKeepFactoriesUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemKeepFactoriesUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "KeepFactoriesUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemKeepFactoriesUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "KeepFactoriesUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseKeepFactoriesUpdated is a log parse operation binding the contract event 0x75cd06e2a95bd62ad447184bf0950b3af3aabd0960994d09da9724686d0c1720. +// +// Solidity: event KeepFactoriesUpdated(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) +func (_TBTCSystem *TBTCSystemFilterer) ParseKeepFactoriesUpdated(log types.Log) (*TBTCSystemKeepFactoriesUpdated, error) { + event := new(TBTCSystemKeepFactoriesUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "KeepFactoriesUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemLiquidatedIterator is returned from FilterLiquidated and is used to iterate over the raw logs and unpacked data for Liquidated events raised by the TBTCSystem contract. +type TBTCSystemLiquidatedIterator struct { + Event *TBTCSystemLiquidated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemLiquidatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemLiquidated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemLiquidated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemLiquidatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemLiquidatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemLiquidated represents a Liquidated event raised by the TBTCSystem contract. +type TBTCSystemLiquidated struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLiquidated is a free log retrieval operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. +// +// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterLiquidated(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemLiquidatedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "Liquidated", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemLiquidatedIterator{contract: _TBTCSystem.contract, event: "Liquidated", logs: logs, sub: sub}, nil +} + +// WatchLiquidated is a free log subscription operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. +// +// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchLiquidated(opts *bind.WatchOpts, sink chan<- *TBTCSystemLiquidated, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "Liquidated", _depositContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemLiquidated) + if err := _TBTCSystem.contract.UnpackLog(event, "Liquidated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseLiquidated is a log parse operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. +// +// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseLiquidated(log types.Log) (*TBTCSystemLiquidated, error) { + event := new(TBTCSystemLiquidated) + if err := _TBTCSystem.contract.UnpackLog(event, "Liquidated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemLotSizesUpdateStartedIterator is returned from FilterLotSizesUpdateStarted and is used to iterate over the raw logs and unpacked data for LotSizesUpdateStarted events raised by the TBTCSystem contract. +type TBTCSystemLotSizesUpdateStartedIterator struct { + Event *TBTCSystemLotSizesUpdateStarted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemLotSizesUpdateStartedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemLotSizesUpdateStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemLotSizesUpdateStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemLotSizesUpdateStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemLotSizesUpdateStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemLotSizesUpdateStarted represents a LotSizesUpdateStarted event raised by the TBTCSystem contract. +type TBTCSystemLotSizesUpdateStarted struct { + LotSizes []uint64 + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLotSizesUpdateStarted is a free log retrieval operation binding the contract event 0xffb1e2bce3c7a63d0cac5492540bd370e1156621adde36cd481262c2846a2b7b. +// +// Solidity: event LotSizesUpdateStarted(uint64[] _lotSizes, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterLotSizesUpdateStarted(opts *bind.FilterOpts) (*TBTCSystemLotSizesUpdateStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "LotSizesUpdateStarted") + if err != nil { + return nil, err + } + return &TBTCSystemLotSizesUpdateStartedIterator{contract: _TBTCSystem.contract, event: "LotSizesUpdateStarted", logs: logs, sub: sub}, nil +} + +// WatchLotSizesUpdateStarted is a free log subscription operation binding the contract event 0xffb1e2bce3c7a63d0cac5492540bd370e1156621adde36cd481262c2846a2b7b. +// +// Solidity: event LotSizesUpdateStarted(uint64[] _lotSizes, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchLotSizesUpdateStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemLotSizesUpdateStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "LotSizesUpdateStarted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemLotSizesUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "LotSizesUpdateStarted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseLotSizesUpdateStarted is a log parse operation binding the contract event 0xffb1e2bce3c7a63d0cac5492540bd370e1156621adde36cd481262c2846a2b7b. +// +// Solidity: event LotSizesUpdateStarted(uint64[] _lotSizes, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseLotSizesUpdateStarted(log types.Log) (*TBTCSystemLotSizesUpdateStarted, error) { + event := new(TBTCSystemLotSizesUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "LotSizesUpdateStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemLotSizesUpdatedIterator is returned from FilterLotSizesUpdated and is used to iterate over the raw logs and unpacked data for LotSizesUpdated events raised by the TBTCSystem contract. +type TBTCSystemLotSizesUpdatedIterator struct { + Event *TBTCSystemLotSizesUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemLotSizesUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemLotSizesUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemLotSizesUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemLotSizesUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemLotSizesUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemLotSizesUpdated represents a LotSizesUpdated event raised by the TBTCSystem contract. +type TBTCSystemLotSizesUpdated struct { + LotSizes []uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLotSizesUpdated is a free log retrieval operation binding the contract event 0xa801e49d33e856d89d06e647753d9d9dda3d0b0520c4346290ada455a00cafcc. +// +// Solidity: event LotSizesUpdated(uint64[] _lotSizes) +func (_TBTCSystem *TBTCSystemFilterer) FilterLotSizesUpdated(opts *bind.FilterOpts) (*TBTCSystemLotSizesUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "LotSizesUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemLotSizesUpdatedIterator{contract: _TBTCSystem.contract, event: "LotSizesUpdated", logs: logs, sub: sub}, nil +} + +// WatchLotSizesUpdated is a free log subscription operation binding the contract event 0xa801e49d33e856d89d06e647753d9d9dda3d0b0520c4346290ada455a00cafcc. +// +// Solidity: event LotSizesUpdated(uint64[] _lotSizes) +func (_TBTCSystem *TBTCSystemFilterer) WatchLotSizesUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemLotSizesUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "LotSizesUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemLotSizesUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "LotSizesUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseLotSizesUpdated is a log parse operation binding the contract event 0xa801e49d33e856d89d06e647753d9d9dda3d0b0520c4346290ada455a00cafcc. +// +// Solidity: event LotSizesUpdated(uint64[] _lotSizes) +func (_TBTCSystem *TBTCSystemFilterer) ParseLotSizesUpdated(log types.Log) (*TBTCSystemLotSizesUpdated, error) { + event := new(TBTCSystemLotSizesUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "LotSizesUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TBTCSystem contract. +type TBTCSystemOwnershipTransferredIterator struct { + Event *TBTCSystemOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemOwnershipTransferred represents a OwnershipTransferred event raised by the TBTCSystem contract. +type TBTCSystemOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TBTCSystem *TBTCSystemFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TBTCSystemOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &TBTCSystemOwnershipTransferredIterator{contract: _TBTCSystem.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TBTCSystem *TBTCSystemFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TBTCSystemOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemOwnershipTransferred) + if err := _TBTCSystem.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TBTCSystem *TBTCSystemFilterer) ParseOwnershipTransferred(log types.Log) (*TBTCSystemOwnershipTransferred, error) { + event := new(TBTCSystemOwnershipTransferred) + if err := _TBTCSystem.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemRedeemedIterator is returned from FilterRedeemed and is used to iterate over the raw logs and unpacked data for Redeemed events raised by the TBTCSystem contract. +type TBTCSystemRedeemedIterator struct { + Event *TBTCSystemRedeemed // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemRedeemedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemRedeemed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemRedeemed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemRedeemedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemRedeemedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemRedeemed represents a Redeemed event raised by the TBTCSystem contract. +type TBTCSystemRedeemed struct { + DepositContractAddress common.Address + Txid [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRedeemed is a free log retrieval operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. +// +// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterRedeemed(opts *bind.FilterOpts, _depositContractAddress []common.Address, _txid [][32]byte) (*TBTCSystemRedeemedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "Redeemed", _depositContractAddressRule, _txidRule) + if err != nil { + return nil, err + } + return &TBTCSystemRedeemedIterator{contract: _TBTCSystem.contract, event: "Redeemed", logs: logs, sub: sub}, nil +} + +// WatchRedeemed is a free log subscription operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. +// +// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchRedeemed(opts *bind.WatchOpts, sink chan<- *TBTCSystemRedeemed, _depositContractAddress []common.Address, _txid [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "Redeemed", _depositContractAddressRule, _txidRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemRedeemed) + if err := _TBTCSystem.contract.UnpackLog(event, "Redeemed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRedeemed is a log parse operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. +// +// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseRedeemed(log types.Log) (*TBTCSystemRedeemed, error) { + event := new(TBTCSystemRedeemed) + if err := _TBTCSystem.contract.UnpackLog(event, "Redeemed", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemRedemptionRequestedIterator is returned from FilterRedemptionRequested and is used to iterate over the raw logs and unpacked data for RedemptionRequested events raised by the TBTCSystem contract. +type TBTCSystemRedemptionRequestedIterator struct { + Event *TBTCSystemRedemptionRequested // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemRedemptionRequestedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemRedemptionRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemRedemptionRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemRedemptionRequestedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemRedemptionRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemRedemptionRequested represents a RedemptionRequested event raised by the TBTCSystem contract. +type TBTCSystemRedemptionRequested struct { + DepositContractAddress common.Address + Requester common.Address + Digest [32]byte + UtxoValue *big.Int + RedeemerOutputScript []byte + RequestedFee *big.Int + Outpoint []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRedemptionRequested is a free log retrieval operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. +// +// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) +func (_TBTCSystem *TBTCSystemFilterer) FilterRedemptionRequested(opts *bind.FilterOpts, _depositContractAddress []common.Address, _requester []common.Address, _digest [][32]byte) (*TBTCSystemRedemptionRequestedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _requesterRule []interface{} + for _, _requesterItem := range _requester { + _requesterRule = append(_requesterRule, _requesterItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "RedemptionRequested", _depositContractAddressRule, _requesterRule, _digestRule) + if err != nil { + return nil, err + } + return &TBTCSystemRedemptionRequestedIterator{contract: _TBTCSystem.contract, event: "RedemptionRequested", logs: logs, sub: sub}, nil +} + +// WatchRedemptionRequested is a free log subscription operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. +// +// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) +func (_TBTCSystem *TBTCSystemFilterer) WatchRedemptionRequested(opts *bind.WatchOpts, sink chan<- *TBTCSystemRedemptionRequested, _depositContractAddress []common.Address, _requester []common.Address, _digest [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _requesterRule []interface{} + for _, _requesterItem := range _requester { + _requesterRule = append(_requesterRule, _requesterItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "RedemptionRequested", _depositContractAddressRule, _requesterRule, _digestRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemRedemptionRequested) + if err := _TBTCSystem.contract.UnpackLog(event, "RedemptionRequested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRedemptionRequested is a log parse operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. +// +// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) +func (_TBTCSystem *TBTCSystemFilterer) ParseRedemptionRequested(log types.Log) (*TBTCSystemRedemptionRequested, error) { + event := new(TBTCSystemRedemptionRequested) + if err := _TBTCSystem.contract.UnpackLog(event, "RedemptionRequested", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemRegisteredPubkeyIterator is returned from FilterRegisteredPubkey and is used to iterate over the raw logs and unpacked data for RegisteredPubkey events raised by the TBTCSystem contract. +type TBTCSystemRegisteredPubkeyIterator struct { + Event *TBTCSystemRegisteredPubkey // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemRegisteredPubkeyIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemRegisteredPubkey) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemRegisteredPubkey) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemRegisteredPubkeyIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemRegisteredPubkeyIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemRegisteredPubkey represents a RegisteredPubkey event raised by the TBTCSystem contract. +type TBTCSystemRegisteredPubkey struct { + DepositContractAddress common.Address + SigningGroupPubkeyX [32]byte + SigningGroupPubkeyY [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRegisteredPubkey is a free log retrieval operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. +// +// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterRegisteredPubkey(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemRegisteredPubkeyIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "RegisteredPubkey", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemRegisteredPubkeyIterator{contract: _TBTCSystem.contract, event: "RegisteredPubkey", logs: logs, sub: sub}, nil +} + +// WatchRegisteredPubkey is a free log subscription operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. +// +// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchRegisteredPubkey(opts *bind.WatchOpts, sink chan<- *TBTCSystemRegisteredPubkey, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "RegisteredPubkey", _depositContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemRegisteredPubkey) + if err := _TBTCSystem.contract.UnpackLog(event, "RegisteredPubkey", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRegisteredPubkey is a log parse operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. +// +// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseRegisteredPubkey(log types.Log) (*TBTCSystemRegisteredPubkey, error) { + event := new(TBTCSystemRegisteredPubkey) + if err := _TBTCSystem.contract.UnpackLog(event, "RegisteredPubkey", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemSetupFailedIterator is returned from FilterSetupFailed and is used to iterate over the raw logs and unpacked data for SetupFailed events raised by the TBTCSystem contract. +type TBTCSystemSetupFailedIterator struct { + Event *TBTCSystemSetupFailed // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemSetupFailedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemSetupFailed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemSetupFailed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemSetupFailedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemSetupFailedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemSetupFailed represents a SetupFailed event raised by the TBTCSystem contract. +type TBTCSystemSetupFailed struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetupFailed is a free log retrieval operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. +// +// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterSetupFailed(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemSetupFailedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "SetupFailed", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemSetupFailedIterator{contract: _TBTCSystem.contract, event: "SetupFailed", logs: logs, sub: sub}, nil +} + +// WatchSetupFailed is a free log subscription operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. +// +// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchSetupFailed(opts *bind.WatchOpts, sink chan<- *TBTCSystemSetupFailed, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "SetupFailed", _depositContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemSetupFailed) + if err := _TBTCSystem.contract.UnpackLog(event, "SetupFailed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSetupFailed is a log parse operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. +// +// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseSetupFailed(log types.Log) (*TBTCSystemSetupFailed, error) { + event := new(TBTCSystemSetupFailed) + if err := _TBTCSystem.contract.UnpackLog(event, "SetupFailed", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemSignerFeeDivisorUpdateStartedIterator is returned from FilterSignerFeeDivisorUpdateStarted and is used to iterate over the raw logs and unpacked data for SignerFeeDivisorUpdateStarted events raised by the TBTCSystem contract. +type TBTCSystemSignerFeeDivisorUpdateStartedIterator struct { + Event *TBTCSystemSignerFeeDivisorUpdateStarted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemSignerFeeDivisorUpdateStartedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemSignerFeeDivisorUpdateStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemSignerFeeDivisorUpdateStarted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemSignerFeeDivisorUpdateStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemSignerFeeDivisorUpdateStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemSignerFeeDivisorUpdateStarted represents a SignerFeeDivisorUpdateStarted event raised by the TBTCSystem contract. +type TBTCSystemSignerFeeDivisorUpdateStarted struct { + SignerFeeDivisor uint16 + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignerFeeDivisorUpdateStarted is a free log retrieval operation binding the contract event 0x38cb7049f0daf658ca989e9ef6b850ef11e3740ff07a0c16706042c39adf48fc. +// +// Solidity: event SignerFeeDivisorUpdateStarted(uint16 _signerFeeDivisor, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterSignerFeeDivisorUpdateStarted(opts *bind.FilterOpts) (*TBTCSystemSignerFeeDivisorUpdateStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "SignerFeeDivisorUpdateStarted") + if err != nil { + return nil, err + } + return &TBTCSystemSignerFeeDivisorUpdateStartedIterator{contract: _TBTCSystem.contract, event: "SignerFeeDivisorUpdateStarted", logs: logs, sub: sub}, nil +} + +// WatchSignerFeeDivisorUpdateStarted is a free log subscription operation binding the contract event 0x38cb7049f0daf658ca989e9ef6b850ef11e3740ff07a0c16706042c39adf48fc. +// +// Solidity: event SignerFeeDivisorUpdateStarted(uint16 _signerFeeDivisor, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchSignerFeeDivisorUpdateStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemSignerFeeDivisorUpdateStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "SignerFeeDivisorUpdateStarted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemSignerFeeDivisorUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "SignerFeeDivisorUpdateStarted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSignerFeeDivisorUpdateStarted is a log parse operation binding the contract event 0x38cb7049f0daf658ca989e9ef6b850ef11e3740ff07a0c16706042c39adf48fc. +// +// Solidity: event SignerFeeDivisorUpdateStarted(uint16 _signerFeeDivisor, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseSignerFeeDivisorUpdateStarted(log types.Log) (*TBTCSystemSignerFeeDivisorUpdateStarted, error) { + event := new(TBTCSystemSignerFeeDivisorUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "SignerFeeDivisorUpdateStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemSignerFeeDivisorUpdatedIterator is returned from FilterSignerFeeDivisorUpdated and is used to iterate over the raw logs and unpacked data for SignerFeeDivisorUpdated events raised by the TBTCSystem contract. +type TBTCSystemSignerFeeDivisorUpdatedIterator struct { + Event *TBTCSystemSignerFeeDivisorUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemSignerFeeDivisorUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemSignerFeeDivisorUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemSignerFeeDivisorUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemSignerFeeDivisorUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemSignerFeeDivisorUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemSignerFeeDivisorUpdated represents a SignerFeeDivisorUpdated event raised by the TBTCSystem contract. +type TBTCSystemSignerFeeDivisorUpdated struct { + SignerFeeDivisor uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignerFeeDivisorUpdated is a free log retrieval operation binding the contract event 0x236dec26d53c6a51390e98ed703106e132fd062b0e38b8a9cf8b4d13f47952c8. +// +// Solidity: event SignerFeeDivisorUpdated(uint16 _signerFeeDivisor) +func (_TBTCSystem *TBTCSystemFilterer) FilterSignerFeeDivisorUpdated(opts *bind.FilterOpts) (*TBTCSystemSignerFeeDivisorUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "SignerFeeDivisorUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemSignerFeeDivisorUpdatedIterator{contract: _TBTCSystem.contract, event: "SignerFeeDivisorUpdated", logs: logs, sub: sub}, nil +} + +// WatchSignerFeeDivisorUpdated is a free log subscription operation binding the contract event 0x236dec26d53c6a51390e98ed703106e132fd062b0e38b8a9cf8b4d13f47952c8. +// +// Solidity: event SignerFeeDivisorUpdated(uint16 _signerFeeDivisor) +func (_TBTCSystem *TBTCSystemFilterer) WatchSignerFeeDivisorUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemSignerFeeDivisorUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "SignerFeeDivisorUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemSignerFeeDivisorUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "SignerFeeDivisorUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSignerFeeDivisorUpdated is a log parse operation binding the contract event 0x236dec26d53c6a51390e98ed703106e132fd062b0e38b8a9cf8b4d13f47952c8. +// +// Solidity: event SignerFeeDivisorUpdated(uint16 _signerFeeDivisor) +func (_TBTCSystem *TBTCSystemFilterer) ParseSignerFeeDivisorUpdated(log types.Log) (*TBTCSystemSignerFeeDivisorUpdated, error) { + event := new(TBTCSystemSignerFeeDivisorUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "SignerFeeDivisorUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemStartedLiquidationIterator is returned from FilterStartedLiquidation and is used to iterate over the raw logs and unpacked data for StartedLiquidation events raised by the TBTCSystem contract. +type TBTCSystemStartedLiquidationIterator struct { + Event *TBTCSystemStartedLiquidation // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TBTCSystemStartedLiquidationIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TBTCSystemStartedLiquidation) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TBTCSystemStartedLiquidation) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TBTCSystemStartedLiquidationIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemStartedLiquidationIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemStartedLiquidation represents a StartedLiquidation event raised by the TBTCSystem contract. +type TBTCSystemStartedLiquidation struct { + DepositContractAddress common.Address + WasFraud bool + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStartedLiquidation is a free log retrieval operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. +// +// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterStartedLiquidation(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemStartedLiquidationIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "StartedLiquidation", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemStartedLiquidationIterator{contract: _TBTCSystem.contract, event: "StartedLiquidation", logs: logs, sub: sub}, nil +} + +// WatchStartedLiquidation is a free log subscription operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. +// +// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchStartedLiquidation(opts *bind.WatchOpts, sink chan<- *TBTCSystemStartedLiquidation, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "StartedLiquidation", _depositContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TBTCSystemStartedLiquidation) + if err := _TBTCSystem.contract.UnpackLog(event, "StartedLiquidation", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStartedLiquidation is a log parse operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. +// +// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseStartedLiquidation(log types.Log) (*TBTCSystemStartedLiquidation, error) { + event := new(TBTCSystemStartedLiquidation) + if err := _TBTCSystem.contract.UnpackLog(event, "StartedLiquidation", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/pkg/chain/ethereum/gen/contract/.keep b/pkg/chain/ethereum/gen/contract/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/chain/ethereum/gen/contract/Deposit.go b/pkg/chain/ethereum/gen/contract/Deposit.go new file mode 100644 index 000000000..ebba81f54 --- /dev/null +++ b/pkg/chain/ethereum/gen/contract/Deposit.go @@ -0,0 +1,3791 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contract + +import ( + "fmt" + "math/big" + "strings" + "sync" + + ethereumabi "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/ipfs/go-log" + + "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + abi "github.com/keep-network/tbtc/pkg/chain/ethereum/gen/abi/deposit" +) + +// Create a package-level logger for this contract. The logger exists at +// package level so that the logger is registered at startup and can be +// included or excluded from logging at startup by name. +var dLogger = log.Logger("keep-contract-Deposit") + +type Deposit struct { + contract *abi.Deposit + contractAddress common.Address + contractABI *ethereumabi.ABI + caller bind.ContractCaller + transactor bind.ContractTransactor + callerOptions *bind.CallOpts + transactorOptions *bind.TransactOpts + errorResolver *ethutil.ErrorResolver + nonceManager *ethutil.NonceManager + miningWaiter *ethutil.MiningWaiter + + transactionMutex *sync.Mutex +} + +func NewDeposit( + contractAddress common.Address, + accountKey *keystore.Key, + backend bind.ContractBackend, + nonceManager *ethutil.NonceManager, + miningWaiter *ethutil.MiningWaiter, + transactionMutex *sync.Mutex, +) (*Deposit, error) { + callerOptions := &bind.CallOpts{ + From: accountKey.Address, + } + + transactorOptions := bind.NewKeyedTransactor( + accountKey.PrivateKey, + ) + + randomBeaconContract, err := abi.NewDeposit( + contractAddress, + backend, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to instantiate contract at address: %s [%v]", + contractAddress.String(), + err, + ) + } + + contractABI, err := ethereumabi.JSON(strings.NewReader(abi.DepositABI)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate ABI: [%v]", err) + } + + return &Deposit{ + contract: randomBeaconContract, + contractAddress: contractAddress, + contractABI: &contractABI, + caller: backend, + transactor: backend, + callerOptions: callerOptions, + transactorOptions: transactorOptions, + errorResolver: ethutil.NewErrorResolver(backend, &contractABI, &contractAddress), + nonceManager: nonceManager, + miningWaiter: miningWaiter, + transactionMutex: transactionMutex, + }, nil +} + +// ----- Non-const Methods ------ + +// Transaction submission. +func (d *Deposit) ProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideRedemptionProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.ProvideRedemptionProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideRedemptionProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideRedemptionProof", + &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return err +} + +func (d *Deposit) ProvideRedemptionProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideRedemptionProof", + d.contractABI, + d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyRedemptionProofTimedOut( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyRedemptionProofTimedOut", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionProofTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionProofTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyRedemptionProofTimedOut( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyRedemptionProofTimedOut", + &result, + ) + + return err +} + +func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyRedemptionProofTimedOut", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifySignerSetupFailed( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifySignerSetupFailed", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.NotifySignerSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifySignerSetupFailed", + ) + } + + dLogger.Infof( + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifySignerSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifySignerSetupFailed", + ) + } + + dLogger.Infof( + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifySignerSetupFailed( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifySignerSetupFailed", + &result, + ) + + return err +} + +func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifySignerSetupFailed", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.ProvideECDSAFraudProof( + transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + } + + dLogger.Infof( + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideECDSAFraudProof( + transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + } + + dLogger.Infof( + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideECDSAFraudProof", + &result, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + + return err +} + +func (d *Deposit) ProvideECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideECDSAFraudProof", + d.contractABI, + d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) IncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction increaseRedemptionFee", + "params: ", + fmt.Sprint( + _previousOutputValueBytes, + _newOutputValueBytes, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.IncreaseRedemptionFee( + transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, + ) + } + + dLogger.Infof( + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.IncreaseRedemptionFee( + transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, + ) + } + + dLogger.Infof( + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallIncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "increaseRedemptionFee", + &result, + _previousOutputValueBytes, + _newOutputValueBytes, + ) + + return err +} + +func (d *Deposit) IncreaseRedemptionFeeGasEstimate( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "increaseRedemptionFee", + d.contractABI, + d.transactor, + _previousOutputValueBytes, + _newOutputValueBytes, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyCourtesyCallExpired( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyCourtesyCallExpired", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.NotifyCourtesyCallExpired( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyCourtesyCallExpired", + ) + } + + dLogger.Infof( + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyCourtesyCallExpired( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyCourtesyCallExpired", + ) + } + + dLogger.Infof( + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyCourtesyCallExpired( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyCourtesyCallExpired", + &result, + ) + + return err +} + +func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyCourtesyCallExpired", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyUndercollateralizedLiquidation( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyUndercollateralizedLiquidation", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyUndercollateralizedLiquidation", + ) + } + + dLogger.Infof( + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyUndercollateralizedLiquidation", + ) + } + + dLogger.Infof( + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyUndercollateralizedLiquidation( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyUndercollateralizedLiquidation", + &result, + ) + + return err +} + +func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyUndercollateralizedLiquidation", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) RequestFunderAbort( + _abortOutputScript []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction requestFunderAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.RequestFunderAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "requestFunderAbort", + _abortOutputScript, + ) + } + + dLogger.Infof( + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.RequestFunderAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "requestFunderAbort", + _abortOutputScript, + ) + } + + dLogger.Infof( + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallRequestFunderAbort( + _abortOutputScript []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "requestFunderAbort", + &result, + _abortOutputScript, + ) + + return err +} + +func (d *Deposit) RequestFunderAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "requestFunderAbort", + d.contractABI, + d.transactor, + _abortOutputScript, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideFundingECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + } + + dLogger.Infof( + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + } + + dLogger.Infof( + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideFundingECDSAFraudProof", + &result, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + + return err +} + +func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideFundingECDSAFraudProof", + d.contractABI, + d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) RequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction requestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.RequestRedemption( + transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, + ) + } + + dLogger.Infof( + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.RequestRedemption( + transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, + ) + } + + dLogger.Infof( + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "requestRedemption", + &result, + _outputValueBytes, + _redeemerOutputScript, + ) + + return err +} + +func (d *Deposit) RequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "requestRedemption", + d.contractABI, + d.transactor, + _outputValueBytes, + _redeemerOutputScript, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) TransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction transferAndRequestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.TransferAndRequestRedemption( + transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + } + + dLogger.Infof( + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.TransferAndRequestRedemption( + transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + } + + dLogger.Infof( + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallTransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "transferAndRequestRedemption", + &result, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + + return err +} + +func (d *Deposit) TransferAndRequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "transferAndRequestRedemption", + d.contractABI, + d.transactor, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyRedemptionSignatureTimedOut( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyRedemptionSignatureTimedOut", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionSignatureTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionSignatureTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyRedemptionSignatureTimedOut", + &result, + ) + + return err +} + +func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyRedemptionSignatureTimedOut", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideRedemptionSignature", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.ProvideRedemptionSignature( + transactorOptions, + _v, + _r, + _s, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionSignature", + _v, + _r, + _s, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideRedemptionSignature( + transactorOptions, + _v, + _r, + _s, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionSignature", + _v, + _r, + _s, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideRedemptionSignature", + &result, + _v, + _r, + _s, + ) + + return err +} + +func (d *Deposit) ProvideRedemptionSignatureGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideRedemptionSignature", + d.contractABI, + d.transactor, + _v, + _r, + _s, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyFundingTimedOut( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyFundingTimedOut", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.NotifyFundingTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyFundingTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyFundingTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyFundingTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyFundingTimedOut( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyFundingTimedOut", + &result, + ) + + return err +} + +func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyFundingTimedOut", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ExitCourtesyCall( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction exitCourtesyCall", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.ExitCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "exitCourtesyCall", + ) + } + + dLogger.Infof( + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ExitCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "exitCourtesyCall", + ) + } + + dLogger.Infof( + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallExitCourtesyCall( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "exitCourtesyCall", + &result, + ) + + return err +} + +func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "exitCourtesyCall", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) Initialize( + _factory common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _factory, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.Initialize( + transactorOptions, + _factory, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "initialize", + _factory, + ) + } + + dLogger.Infof( + "submitted transaction initialize with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.Initialize( + transactorOptions, + _factory, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "initialize", + _factory, + ) + } + + dLogger.Infof( + "submitted transaction initialize with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallInitialize( + _factory common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "initialize", + &result, + _factory, + ) + + return err +} + +func (d *Deposit) InitializeGasEstimate( + _factory common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "initialize", + d.contractABI, + d.transactor, + _factory, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) WithdrawFunds( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction withdrawFunds", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.WithdrawFunds( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "withdrawFunds", + ) + } + + dLogger.Infof( + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.WithdrawFunds( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "withdrawFunds", + ) + } + + dLogger.Infof( + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallWithdrawFunds( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "withdrawFunds", + &result, + ) + + return err +} + +func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "withdrawFunds", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) PurchaseSignerBondsAtAuction( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction purchaseSignerBondsAtAuction", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "purchaseSignerBondsAtAuction", + ) + } + + dLogger.Infof( + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "purchaseSignerBondsAtAuction", + ) + } + + dLogger.Infof( + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallPurchaseSignerBondsAtAuction( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "purchaseSignerBondsAtAuction", + &result, + ) + + return err +} + +func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "purchaseSignerBondsAtAuction", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) RetrieveSignerPubkey( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction retrieveSignerPubkey", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.RetrieveSignerPubkey( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "retrieveSignerPubkey", + ) + } + + dLogger.Infof( + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.RetrieveSignerPubkey( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "retrieveSignerPubkey", + ) + } + + dLogger.Infof( + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallRetrieveSignerPubkey( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "retrieveSignerPubkey", + &result, + ) + + return err +} + +func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "retrieveSignerPubkey", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) InitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction initializeDeposit", + "params: ", + fmt.Sprint( + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ), + "value: ", value, + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + transactorOptions.Value = value + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.InitializeDeposit( + transactorOptions, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + } + + dLogger.Infof( + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.InitializeDeposit( + transactorOptions, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + } + + dLogger.Infof( + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallInitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, value, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "initializeDeposit", + &result, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + + return err +} + +func (d *Deposit) InitializeDepositGasEstimate( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "initializeDeposit", + d.contractABI, + d.transactor, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyCourtesyCall( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyCourtesyCall", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.NotifyCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyCourtesyCall", + ) + } + + dLogger.Infof( + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyCourtesyCall", + ) + } + + dLogger.Infof( + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyCourtesyCall( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyCourtesyCall", + &result, + ) + + return err +} + +func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyCourtesyCall", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideBTCFundingProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := d.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := d.contract.ProvideBTCFundingProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideBTCFundingProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideBTCFundingProof", + &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return err +} + +func (d *Deposit) ProvideBTCFundingProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideBTCFundingProof", + d.contractABI, + d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return result, err +} + +// ----- Const Methods ------ + +func (d *Deposit) LotSizeTbtc() (*big.Int, error) { + var result *big.Int + result, err := d.contract.LotSizeTbtc( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "lotSizeTbtc", + ) + } + + return result, err +} + +func (d *Deposit) LotSizeTbtcAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "lotSizeTbtc", + &result, + ) + + return result, err +} + +func (d *Deposit) GetOwnerRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetOwnerRedemptionTbtcRequirement( + d.callerOptions, + _redeemer, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "getOwnerRedemptionTbtcRequirement", + _redeemer, + ) + } + + return result, err +} + +func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "getOwnerRedemptionTbtcRequirement", + &result, + _redeemer, + ) + + return result, err +} + +func (d *Deposit) CurrentState() (*big.Int, error) { + var result *big.Int + result, err := d.contract.CurrentState( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "currentState", + ) + } + + return result, err +} + +func (d *Deposit) CurrentStateAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "currentState", + &result, + ) + + return result, err +} + +func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := d.contract.InitialCollateralizedPercent( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "initialCollateralizedPercent", + ) + } + + return result, err +} + +func (d *Deposit) InitialCollateralizedPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "initialCollateralizedPercent", + &result, + ) + + return result, err +} + +func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { + var result *big.Int + result, err := d.contract.CollateralizationPercentage( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "collateralizationPercentage", + ) + } + + return result, err +} + +func (d *Deposit) CollateralizationPercentageAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "collateralizationPercentage", + &result, + ) + + return result, err +} + +type fundingInfo struct { + UtxoValueBytes [8]uint8 + FundedAt *big.Int + UtxoOutpoint []uint8 +} + +func (d *Deposit) FundingInfo() (fundingInfo, error) { + var result fundingInfo + result, err := d.contract.FundingInfo( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "fundingInfo", + ) + } + + return result, err +} + +func (d *Deposit) FundingInfoAtBlock( + blockNumber *big.Int, +) (fundingInfo, error) { + var result fundingInfo + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "fundingInfo", + &result, + ) + + return result, err +} + +func (d *Deposit) InActive() (bool, error) { + var result bool + result, err := d.contract.InActive( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "inActive", + ) + } + + return result, err +} + +func (d *Deposit) InActiveAtBlock( + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "inActive", + &result, + ) + + return result, err +} + +func (d *Deposit) WithdrawableAmount() (*big.Int, error) { + var result *big.Int + result, err := d.contract.WithdrawableAmount( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "withdrawableAmount", + ) + } + + return result, err +} + +func (d *Deposit) WithdrawableAmountAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "withdrawableAmount", + &result, + ) + + return result, err +} + +func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "severelyUndercollateralizedThresholdPercent", + ) + } + + return result, err +} + +func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "severelyUndercollateralizedThresholdPercent", + &result, + ) + + return result, err +} + +func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { + var result *big.Int + result, err := d.contract.SignerFeeTbtc( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "signerFeeTbtc", + ) + } + + return result, err +} + +func (d *Deposit) SignerFeeTbtcAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "signerFeeTbtc", + &result, + ) + + return result, err +} + +func (d *Deposit) AuctionValue() (*big.Int, error) { + var result *big.Int + result, err := d.contract.AuctionValue( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "auctionValue", + ) + } + + return result, err +} + +func (d *Deposit) AuctionValueAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "auctionValue", + &result, + ) + + return result, err +} + +func (d *Deposit) GetRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetRedemptionTbtcRequirement( + d.callerOptions, + _redeemer, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "getRedemptionTbtcRequirement", + _redeemer, + ) + } + + return result, err +} + +func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "getRedemptionTbtcRequirement", + &result, + _redeemer, + ) + + return result, err +} + +func (d *Deposit) LotSizeSatoshis() (uint64, error) { + var result uint64 + result, err := d.contract.LotSizeSatoshis( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "lotSizeSatoshis", + ) + } + + return result, err +} + +func (d *Deposit) LotSizeSatoshisAtBlock( + blockNumber *big.Int, +) (uint64, error) { + var result uint64 + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "lotSizeSatoshis", + &result, + ) + + return result, err +} + +func (d *Deposit) UtxoValue() (*big.Int, error) { + var result *big.Int + result, err := d.contract.UtxoValue( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "utxoValue", + ) + } + + return result, err +} + +func (d *Deposit) UtxoValueAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "utxoValue", + &result, + ) + + return result, err +} + +func (d *Deposit) RemainingTerm() (*big.Int, error) { + var result *big.Int + result, err := d.contract.RemainingTerm( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "remainingTerm", + ) + } + + return result, err +} + +func (d *Deposit) RemainingTermAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "remainingTerm", + &result, + ) + + return result, err +} + +func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.UndercollateralizedThresholdPercent( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "undercollateralizedThresholdPercent", + ) + } + + return result, err +} + +func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "undercollateralizedThresholdPercent", + &result, + ) + + return result, err +} + +func (d *Deposit) KeepAddress() (common.Address, error) { + var result common.Address + result, err := d.contract.KeepAddress( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "keepAddress", + ) + } + + return result, err +} + +func (d *Deposit) KeepAddressAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "keepAddress", + &result, + ) + + return result, err +} + +// ------ Events ------- diff --git a/pkg/chain/ethereum/gen/contract/TBTCSystem.go b/pkg/chain/ethereum/gen/contract/TBTCSystem.go new file mode 100644 index 000000000..9b5d42d45 --- /dev/null +++ b/pkg/chain/ethereum/gen/contract/TBTCSystem.go @@ -0,0 +1,8310 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contract + +import ( + "fmt" + "math/big" + "strings" + "sync" + "time" + + ethereumabi "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/ipfs/go-log" + + "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + "github.com/keep-network/keep-common/pkg/subscription" + abi "github.com/keep-network/tbtc/pkg/chain/ethereum/gen/abi/system" +) + +// Create a package-level logger for this contract. The logger exists at +// package level so that the logger is registered at startup and can be +// included or excluded from logging at startup by name. +var tbtcsLogger = log.Logger("keep-contract-TBTCSystem") + +type TBTCSystem struct { + contract *abi.TBTCSystem + contractAddress common.Address + contractABI *ethereumabi.ABI + caller bind.ContractCaller + transactor bind.ContractTransactor + callerOptions *bind.CallOpts + transactorOptions *bind.TransactOpts + errorResolver *ethutil.ErrorResolver + nonceManager *ethutil.NonceManager + miningWaiter *ethutil.MiningWaiter + + transactionMutex *sync.Mutex +} + +func NewTBTCSystem( + contractAddress common.Address, + accountKey *keystore.Key, + backend bind.ContractBackend, + nonceManager *ethutil.NonceManager, + miningWaiter *ethutil.MiningWaiter, + transactionMutex *sync.Mutex, +) (*TBTCSystem, error) { + callerOptions := &bind.CallOpts{ + From: accountKey.Address, + } + + transactorOptions := bind.NewKeyedTransactor( + accountKey.PrivateKey, + ) + + randomBeaconContract, err := abi.NewTBTCSystem( + contractAddress, + backend, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to instantiate contract at address: %s [%v]", + contractAddress.String(), + err, + ) + } + + contractABI, err := ethereumabi.JSON(strings.NewReader(abi.TBTCSystemABI)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate ABI: [%v]", err) + } + + return &TBTCSystem{ + contract: randomBeaconContract, + contractAddress: contractAddress, + contractABI: &contractABI, + caller: backend, + transactor: backend, + callerOptions: callerOptions, + transactorOptions: transactorOptions, + errorResolver: ethutil.NewErrorResolver(backend, &contractABI, &contractAddress), + nonceManager: nonceManager, + miningWaiter: miningWaiter, + transactionMutex: transactionMutex, + }, nil +} + +// ----- Non-const Methods ------ + +// Transaction submission. +func (tbtcs *TBTCSystem) LogLiquidated( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logLiquidated", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogLiquidated( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logLiquidated", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogLiquidated( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logLiquidated", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogLiquidated( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logLiquidated", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logLiquidated", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogExitedCourtesyCall( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logExitedCourtesyCall", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logExitedCourtesyCall", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logExitedCourtesyCall", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logExitedCourtesyCall", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logExitedCourtesyCall", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction refreshMinimumBondableValue", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "refreshMinimumBondableValue", + ) + } + + tbtcsLogger.Infof( + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "refreshMinimumBondableValue", + ) + } + + tbtcsLogger.Infof( + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "refreshMinimumBondableValue", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "refreshMinimumBondableValue", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) TransferOwnership( + newOwner common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction transferOwnership", + "params: ", + fmt.Sprint( + newOwner, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.TransferOwnership( + transactorOptions, + newOwner, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "transferOwnership", + newOwner, + ) + } + + tbtcsLogger.Infof( + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.TransferOwnership( + transactorOptions, + newOwner, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "transferOwnership", + newOwner, + ) + } + + tbtcsLogger.Infof( + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallTransferOwnership( + newOwner common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "transferOwnership", + &result, + newOwner, + ) + + return err +} + +func (tbtcs *TBTCSystem) TransferOwnershipGasEstimate( + newOwner common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "transferOwnership", + tbtcs.contractABI, + tbtcs.transactor, + newOwner, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginKeepFactoriesUpdate", + "params: ", + fmt.Sprint( + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginKeepFactoriesUpdate", + &result, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdateGasEstimate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginKeepFactoriesUpdate", + tbtcs.contractABI, + tbtcs.transactor, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogCourtesyCalled( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logCourtesyCalled", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogCourtesyCalled( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCourtesyCalled", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogCourtesyCalled( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCourtesyCalled", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogCourtesyCalled( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logCourtesyCalled", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logCourtesyCalled", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) RenounceOwnership( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction renounceOwnership", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.RenounceOwnership( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "renounceOwnership", + ) + } + + tbtcsLogger.Infof( + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.RenounceOwnership( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "renounceOwnership", + ) + } + + tbtcsLogger.Infof( + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallRenounceOwnership( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "renounceOwnership", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "renounceOwnership", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogCreated( + _keepAddress common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logCreated", + "params: ", + fmt.Sprint( + _keepAddress, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogCreated( + transactorOptions, + _keepAddress, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCreated", + _keepAddress, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCreated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogCreated( + transactorOptions, + _keepAddress, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCreated", + _keepAddress, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCreated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogCreated( + _keepAddress common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logCreated", + &result, + _keepAddress, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogCreatedGasEstimate( + _keepAddress common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logCreated", + tbtcs.contractABI, + tbtcs.transactor, + _keepAddress, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logRedemptionRequested", + "params: ", + fmt.Sprint( + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogRedemptionRequested( + transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogRedemptionRequested( + transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logRedemptionRequested", + &result, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogRedemptionRequestedGasEstimate( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logRedemptionRequested", + tbtcs.contractABI, + tbtcs.transactor, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logRegisteredPubkey", + "params: ", + fmt.Sprint( + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogRegisteredPubkey( + transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogRegisteredPubkey( + transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logRegisteredPubkey", + &result, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogRegisteredPubkeyGasEstimate( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logRegisteredPubkey", + tbtcs.contractABI, + tbtcs.transactor, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginCollateralizationThresholdsUpdate", + "params: ", + fmt.Sprint( + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transactorOptions, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transactorOptions, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginCollateralizationThresholdsUpdate", + &result, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginCollateralizationThresholdsUpdate", + tbtcs.contractABI, + tbtcs.transactor, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction emergencyPauseNewDeposits", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "emergencyPauseNewDeposits", + ) + } + + tbtcsLogger.Infof( + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "emergencyPauseNewDeposits", + ) + } + + tbtcsLogger.Infof( + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "emergencyPauseNewDeposits", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "emergencyPauseNewDeposits", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogRedeemed( + _txid [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logRedeemed", + "params: ", + fmt.Sprint( + _txid, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogRedeemed( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRedeemed", + _txid, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogRedeemed( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRedeemed", + _txid, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogRedeemed( + _txid [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logRedeemed", + &result, + _txid, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( + _txid [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logRedeemed", + tbtcs.contractABI, + tbtcs.transactor, + _txid, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeCollateralizationThresholdsUpdate", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeCollateralizationThresholdsUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeCollateralizationThresholdsUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeCollateralizationThresholdsUpdate", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeCollateralizationThresholdsUpdate", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) RequestNewKeep( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, + value *big.Int, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction requestNewKeep", + "params: ", + fmt.Sprint( + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ), + "value: ", value, + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + transactorOptions.Value = value + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.RequestNewKeep( + transactorOptions, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + } + + tbtcsLogger.Infof( + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.RequestNewKeep( + transactorOptions, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + } + + tbtcsLogger.Infof( + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallRequestNewKeep( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, + value *big.Int, + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, value, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "requestNewKeep", + &result, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) RequestNewKeepGasEstimate( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "requestNewKeep", + tbtcs.contractABI, + tbtcs.transactor, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogFunderRequestedAbort( + _abortOutputScript []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logFunderRequestedAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogFunderRequestedAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFunderRequestedAbort", + _abortOutputScript, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogFunderRequestedAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFunderRequestedAbort", + _abortOutputScript, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogFunderRequestedAbort( + _abortOutputScript []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logFunderRequestedAbort", + &result, + _abortOutputScript, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogFunderRequestedAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logFunderRequestedAbort", + tbtcs.contractABI, + tbtcs.transactor, + _abortOutputScript, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogStartedLiquidation( + _wasFraud bool, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logStartedLiquidation", + "params: ", + fmt.Sprint( + _wasFraud, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogStartedLiquidation( + transactorOptions, + _wasFraud, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logStartedLiquidation", + _wasFraud, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogStartedLiquidation( + transactorOptions, + _wasFraud, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logStartedLiquidation", + _wasFraud, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogStartedLiquidation( + _wasFraud bool, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logStartedLiquidation", + &result, + _wasFraud, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogStartedLiquidationGasEstimate( + _wasFraud bool, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logStartedLiquidation", + tbtcs.contractABI, + tbtcs.transactor, + _wasFraud, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeEthBtcPriceFeedAddition", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeEthBtcPriceFeedAddition", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeEthBtcPriceFeedAddition", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeEthBtcPriceFeedAddition", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeEthBtcPriceFeedAddition", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeLotSizesUpdate", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeLotSizesUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeLotSizesUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeLotSizesUpdate", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeLotSizesUpdate", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) ResumeNewDeposits( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction resumeNewDeposits", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.ResumeNewDeposits( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "resumeNewDeposits", + ) + } + + tbtcsLogger.Infof( + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.ResumeNewDeposits( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "resumeNewDeposits", + ) + } + + tbtcsLogger.Infof( + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallResumeNewDeposits( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "resumeNewDeposits", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "resumeNewDeposits", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogSetupFailed( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logSetupFailed", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logSetupFailed", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logSetupFailed", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogSetupFailed( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logSetupFailed", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logSetupFailed", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) Initialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.Initialize( + transactorOptions, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + } + + tbtcsLogger.Infof( + "submitted transaction initialize with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.Initialize( + transactorOptions, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + } + + tbtcsLogger.Infof( + "submitted transaction initialize with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallInitialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "initialize", + &result, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + + return err +} + +func (tbtcs *TBTCSystem) InitializeGasEstimate( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "initialize", + tbtcs.contractABI, + tbtcs.transactor, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogFraudDuringSetup( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logFraudDuringSetup", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogFraudDuringSetup( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFraudDuringSetup", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogFraudDuringSetup( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFraudDuringSetup", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogFraudDuringSetup( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logFraudDuringSetup", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logFraudDuringSetup", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginEthBtcPriceFeedAddition", + "params: ", + fmt.Sprint( + _ethBtcPriceFeed, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transactorOptions, + _ethBtcPriceFeed, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transactorOptions, + _ethBtcPriceFeed, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginEthBtcPriceFeedAddition", + &result, + _ethBtcPriceFeed, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( + _ethBtcPriceFeed common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginEthBtcPriceFeedAddition", + tbtcs.contractABI, + tbtcs.transactor, + _ethBtcPriceFeed, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeSignerFeeDivisorUpdate", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeSignerFeeDivisorUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeSignerFeeDivisorUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeSignerFeeDivisorUpdate", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdateGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeSignerFeeDivisorUpdate", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginLotSizesUpdate( + _lotSizes []uint64, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginLotSizesUpdate", + "params: ", + fmt.Sprint( + _lotSizes, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.BeginLotSizesUpdate( + transactorOptions, + _lotSizes, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginLotSizesUpdate", + _lotSizes, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginLotSizesUpdate( + transactorOptions, + _lotSizes, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginLotSizesUpdate", + _lotSizes, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( + _lotSizes []uint64, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginLotSizesUpdate", + &result, + _lotSizes, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginLotSizesUpdateGasEstimate( + _lotSizes []uint64, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginLotSizesUpdate", + tbtcs.contractABI, + tbtcs.transactor, + _lotSizes, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeKeepFactoriesUpdate", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeKeepFactoriesUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeKeepFactoriesUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeKeepFactoriesUpdate", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeKeepFactoriesUpdate", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogFunded( + _txid [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logFunded", + "params: ", + fmt.Sprint( + _txid, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogFunded( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFunded", + _txid, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFunded with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogFunded( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFunded", + _txid, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFunded with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogFunded( + _txid [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logFunded", + &result, + _txid, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogFundedGasEstimate( + _txid [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logFunded", + tbtcs.contractABI, + tbtcs.transactor, + _txid, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginSignerFeeDivisorUpdate", + "params: ", + fmt.Sprint( + _signerFeeDivisor, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transactorOptions, + _signerFeeDivisor, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transactorOptions, + _signerFeeDivisor, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginSignerFeeDivisorUpdate", + &result, + _signerFeeDivisor, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( + _signerFeeDivisor uint16, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginSignerFeeDivisorUpdate", + tbtcs.contractABI, + tbtcs.transactor, + _signerFeeDivisor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logGotRedemptionSignature", + "params: ", + fmt.Sprint( + _digest, + _r, + _s, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := tbtcs.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := tbtcs.contract.LogGotRedemptionSignature( + transactorOptions, + _digest, + _r, + _s, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logGotRedemptionSignature", + _digest, + _r, + _s, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogGotRedemptionSignature( + transactorOptions, + _digest, + _r, + _s, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logGotRedemptionSignature", + _digest, + _r, + _s, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logGotRedemptionSignature", + &result, + _digest, + _r, + _s, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogGotRedemptionSignatureGasEstimate( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logGotRedemptionSignature", + tbtcs.contractABI, + tbtcs.transactor, + _digest, + _r, + _s, + ) + + return result, err +} + +// ----- Const Methods ------ + +func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSignerFeeDivisor( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getSignerFeeDivisor", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getSignerFeeDivisor", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.PriceFeed( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "priceFeed", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) PriceFeedAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "priceFeed", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) Relay() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Relay( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "relay", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) RelayAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "relay", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingCollateralizationThresholdsUpdateTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingCollateralizationThresholdsUpdateTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingSignerFeeDivisorUpdateTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingSignerFeeDivisorUpdateTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingSignerFeeDivisorUpdateTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) Owner() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Owner( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "owner", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) OwnerAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "owner", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) ApprovedToLog( + _caller common.Address, +) (bool, error) { + var result bool + result, err := tbtcs.contract.ApprovedToLog( + tbtcs.callerOptions, + _caller, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "approvedToLog", + _caller, + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( + _caller common.Address, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "approvedToLog", + &result, + _caller, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) IsAllowedLotSize( + _requestedLotSizeSatoshis uint64, +) (bool, error) { + var result bool + result, err := tbtcs.contract.IsAllowedLotSize( + tbtcs.callerOptions, + _requestedLotSizeSatoshis, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "isAllowedLotSize", + _requestedLotSizeSatoshis, + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( + _requestedLotSizeSatoshis uint64, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "isAllowedLotSize", + &result, + _requestedLotSizeSatoshis, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMinimumLotSize( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getMinimumLotSize", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getMinimumLotSize", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchBitcoinPrice( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "fetchBitcoinPrice", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "fetchBitcoinPrice", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchRelayPreviousDifficulty( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "fetchRelayPreviousDifficulty", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "fetchRelayPreviousDifficulty", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingEthBtcPriceFeedAdditionTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingEthBtcPriceFeedAdditionTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) IsOwner() (bool, error) { + var result bool + result, err := tbtcs.contract.IsOwner( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "isOwner", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) IsOwnerAtBlock( + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "isOwner", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingKeepFactoriesUpgradeabilityTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingKeepFactoriesUpgradeabilityTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { + var result bool + result, err := tbtcs.contract.GetAllowNewDeposits( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getAllowNewDeposits", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getAllowNewDeposits", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { + var result []uint64 + result, err := tbtcs.contract.GetAllowedLotSizes( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getAllowedLotSizes", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( + blockNumber *big.Int, +) ([]uint64, error) { + var result []uint64 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getAllowedLotSizes", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetNewDepositFeeEstimate( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getNewDepositFeeEstimate", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getNewDepositFeeEstimate", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetUndercollateralizedThresholdPercent( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getUndercollateralizedThresholdPercent", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getUndercollateralizedThresholdPercent", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetGovernanceTimeDelay( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getGovernanceTimeDelay", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getGovernanceTimeDelay", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpdateTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingKeepFactoriesUpdateTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingKeepFactoriesUpdateTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingPauseTerm( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingPauseTerm", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingPauseTerm", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.KeepSize( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "keepSize", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) KeepSizeAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "keepSize", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getPriceFeedGovernanceTimeDelay", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getPriceFeedGovernanceTimeDelay", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.KeepThreshold( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "keepThreshold", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) KeepThresholdAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "keepThreshold", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSeverelyUndercollateralizedThresholdPercent( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getSeverelyUndercollateralizedThresholdPercent", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getSeverelyUndercollateralizedThresholdPercent", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchRelayCurrentDifficulty( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "fetchRelayCurrentDifficulty", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "fetchRelayCurrentDifficulty", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetKeepFactoriesUpgradeabilityPeriod( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getKeepFactoriesUpgradeabilityPeriod", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getKeepFactoriesUpgradeabilityPeriod", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingLotSizesUpdateTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingLotSizesUpdateTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetInitialCollateralizedPercent( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getInitialCollateralizedPercent", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getInitialCollateralizedPercent", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMaximumLotSize( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getMaximumLotSize", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getMaximumLotSize", + &result, + ) + + return result, err +} + +// ------ Events ------- + +type tBTCSystemStartedLiquidationFunc func( + DepositContractAddress common.Address, + WasFraud bool, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeStartedLiquidation( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event StartedLiquidation terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemStartedLiquidation) + eventSubscription, err := tbtcs.contract.WatchStartedLiquidation( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for StartedLiquidation events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.WasFraud, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemAllowNewDepositsUpdatedFunc func( + AllowNewDeposits bool, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event AllowNewDepositsUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemAllowNewDepositsUpdated) + eventSubscription, err := tbtcs.contract.WatchAllowNewDepositsUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for AllowNewDepositsUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.AllowNewDeposits, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemCreatedFunc func( + DepositContractAddress common.Address, + KeepAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchCreated( + success tBTCSystemCreatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeCreated( + success, + failCallback, + _depositContractAddressFilter, + _keepAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event Created terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeCreated( + success tBTCSystemCreatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemCreated) + eventSubscription, err := tbtcs.contract.WatchCreated( + nil, + eventChan, + _depositContractAddressFilter, + _keepAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Created events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.KeepAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemKeepFactoriesUpdateStartedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeKeepFactoriesUpdateStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event KeepFactoriesUpdateStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdateStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for KeepFactoriesUpdateStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemOwnershipTransferredFunc func( + PreviousOwner common.Address, + NewOwner common.Address, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, + fail func(err error) error, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeOwnershipTransferred( + success, + failCallback, + previousOwnerFilter, + newOwnerFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event OwnershipTransferred terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, + fail func(err error) error, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemOwnershipTransferred) + eventSubscription, err := tbtcs.contract.WatchOwnershipTransferred( + nil, + eventChan, + previousOwnerFilter, + newOwnerFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for OwnershipTransferred events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.PreviousOwner, + event.NewOwner, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemSetupFailedFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchSetupFailed( + success tBTCSystemSetupFailedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeSetupFailed( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event SetupFailed terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeSetupFailed( + success tBTCSystemSetupFailedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemSetupFailed) + eventSubscription, err := tbtcs.contract.WatchSetupFailed( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for SetupFailed events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemCollateralizationThresholdsUpdateStartedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdateStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemExitedCourtesyCallFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeExitedCourtesyCall( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event ExitedCourtesyCall terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemExitedCourtesyCall) + eventSubscription, err := tbtcs.contract.WatchExitedCourtesyCall( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for ExitedCourtesyCall events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemFundedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchFunded( + success tBTCSystemFundedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeFunded( + success, + failCallback, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event Funded terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeFunded( + success tBTCSystemFundedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemFunded) + eventSubscription, err := tbtcs.contract.WatchFunded( + nil, + eventChan, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Funded events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Txid, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemSignerFeeDivisorUpdatedFunc func( + SignerFeeDivisor uint16, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event SignerFeeDivisorUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdated) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for SignerFeeDivisorUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.SignerFeeDivisor, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemCollateralizationThresholdsUpdatedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event CollateralizationThresholdsUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdated) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for CollateralizationThresholdsUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemCourtesyCalledFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeCourtesyCalled( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event CourtesyCalled terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemCourtesyCalled) + eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for CourtesyCalled events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemLotSizesUpdateStartedFunc func( + LotSizes []uint64, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeLotSizesUpdateStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event LotSizesUpdateStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemLotSizesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdateStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for LotSizesUpdateStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.LotSizes, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemFunderAbortRequestedFunc func( + DepositContractAddress common.Address, + AbortOutputScript []uint8, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeFunderAbortRequested( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event FunderAbortRequested terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemFunderAbortRequested) + eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for FunderAbortRequested events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.AbortOutputScript, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemGotRedemptionSignatureFunc func( + DepositContractAddress common.Address, + Digest [32]uint8, + R [32]uint8, + S [32]uint8, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeGotRedemptionSignature( + success, + failCallback, + _depositContractAddressFilter, + _digestFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event GotRedemptionSignature terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemGotRedemptionSignature) + eventSubscription, err := tbtcs.contract.WatchGotRedemptionSignature( + nil, + eventChan, + _depositContractAddressFilter, + _digestFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for GotRedemptionSignature events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Digest, + event.R, + event.S, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemKeepFactoriesUpdatedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeKeepFactoriesUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event KeepFactoriesUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdated) + eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for KeepFactoriesUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemLiquidatedFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchLiquidated( + success tBTCSystemLiquidatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeLiquidated( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event Liquidated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeLiquidated( + success tBTCSystemLiquidatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemLiquidated) + eventSubscription, err := tbtcs.contract.WatchLiquidated( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Liquidated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemLotSizesUpdatedFunc func( + LotSizes []uint64, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeLotSizesUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event LotSizesUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemLotSizesUpdated) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for LotSizesUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.LotSizes, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemEthBtcPriceFeedAddedFunc func( + PriceFeed common.Address, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event EthBtcPriceFeedAdded terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdded) + eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdded( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for EthBtcPriceFeedAdded events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.PriceFeed, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemEthBtcPriceFeedAdditionStartedFunc func( + PriceFeed common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( + success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdditionStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event EthBtcPriceFeedAdditionStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( + success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdditionStarted) + eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdditionStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for EthBtcPriceFeedAdditionStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.PriceFeed, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemFraudDuringSetupFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeFraudDuringSetup( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event FraudDuringSetup terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemFraudDuringSetup) + eventSubscription, err := tbtcs.contract.WatchFraudDuringSetup( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for FraudDuringSetup events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( + SignerFeeDivisor uint16, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for SignerFeeDivisorUpdateStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.SignerFeeDivisor, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemRedeemedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchRedeemed( + success tBTCSystemRedeemedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeRedeemed( + success, + failCallback, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event Redeemed terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeRedeemed( + success tBTCSystemRedeemedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemRedeemed) + eventSubscription, err := tbtcs.contract.WatchRedeemed( + nil, + eventChan, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Redeemed events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Txid, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemRedemptionRequestedFunc func( + DepositContractAddress common.Address, + Requester common.Address, + Digest [32]uint8, + UtxoValue *big.Int, + RedeemerOutputScript []uint8, + RequestedFee *big.Int, + Outpoint []uint8, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeRedemptionRequested( + success, + failCallback, + _depositContractAddressFilter, + _requesterFilter, + _digestFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event RedemptionRequested terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemRedemptionRequested) + eventSubscription, err := tbtcs.contract.WatchRedemptionRequested( + nil, + eventChan, + _depositContractAddressFilter, + _requesterFilter, + _digestFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for RedemptionRequested events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Requester, + event.Digest, + event.UtxoValue, + event.RedeemerOutputScript, + event.RequestedFee, + event.Outpoint, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemRegisteredPubkeyFunc func( + DepositContractAddress common.Address, + SigningGroupPubkeyX [32]uint8, + SigningGroupPubkeyY [32]uint8, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeRegisteredPubkey( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event RegisteredPubkey terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemRegisteredPubkey) + eventSubscription, err := tbtcs.contract.WatchRegisteredPubkey( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for RegisteredPubkey events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.SigningGroupPubkeyX, + event.SigningGroupPubkeyY, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} diff --git a/pkg/chain/ethereum/gen/gen.go b/pkg/chain/ethereum/gen/gen.go new file mode 100644 index 000000000..c0db2dd19 --- /dev/null +++ b/pkg/chain/ethereum/gen/gen.go @@ -0,0 +1,3 @@ +package gen + +//go:generate sh -c "SOLIDITY_DIR=../../../../solidity SOLIDITY_FILES='deposit/Deposit.sol system/TBTCSystem.sol' make"