From a4e117d4dde3881e61b4ddf4eebdfbeaebf82959 Mon Sep 17 00:00:00 2001 From: Rodrigo <95635797+poly-rodr@users.noreply.github.com> Date: Mon, 11 Dec 2023 09:06:15 -0300 Subject: [PATCH] [PLAT-633] Neg Risk adaptations (#13) * Neg Risk adaptations * renaming * adding the neg risk binding code * updating neg risk binding * final contract * test fixes * fixing contracts and addresses * naming * adding neg risk adapter * ctf contracts code update * new addresses --- go.mod | 21 +- go.sum | 82 +- pkg/builder/exchange_order_builder.go | 5 +- pkg/builder/exchange_order_builder_impl.go | 11 +- .../exchange_order_builder_impl_test.go | 174 +- pkg/builder/mocks/ExchangeOrderBuilder.go | 136 + pkg/config/config.go | 33 +- pkg/config/config_test.go | 28 +- .../{exchange-fees.go => exchange_fees.go} | 437 +- pkg/contracts/exchange/exchange.go | 31 +- .../neg-risk-fees/neg_risk_exchange_fees.go | 1080 +++++ pkg/contracts/neg-risk/neg_risk_exchange.go | 3566 +++++++++++++++++ pkg/model/module.go | 8 + pkg/utils/module.go | 26 + pkg/utils/module_test.go | 37 + 15 files changed, 5364 insertions(+), 311 deletions(-) create mode 100644 pkg/builder/mocks/ExchangeOrderBuilder.go rename pkg/contracts/exchange-fees/{exchange-fees.go => exchange_fees.go} (71%) create mode 100644 pkg/contracts/neg-risk-fees/neg_risk_exchange_fees.go create mode 100644 pkg/contracts/neg-risk/neg_risk_exchange.go create mode 100644 pkg/model/module.go create mode 100644 pkg/utils/module.go create mode 100644 pkg/utils/module_test.go diff --git a/go.mod b/go.mod index 1ef8554..2aaa070 100644 --- a/go.mod +++ b/go.mod @@ -3,22 +3,22 @@ module github.com/polymarket/go-order-utils go 1.21 require ( - github.com/ethereum/go-ethereum v1.13.0 + github.com/ethereum/go-ethereum v1.13.5 github.com/stretchr/testify v1.8.4 ) require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/StackExchange/wmi v1.2.1 // indirect - github.com/bits-and-blooms/bitset v1.5.0 // indirect + github.com/bits-and-blooms/bitset v1.7.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/consensys/bavard v0.1.13 // indirect - github.com/consensys/gnark-crypto v0.10.0 // indirect - github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect + github.com/consensys/gnark-crypto v0.12.1 // indirect + github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect - github.com/ethereum/c-kzg-4844 v0.3.1 // indirect + github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-ole/go-ole v1.2.5 // indirect github.com/go-stack/stack v1.8.1 // indirect @@ -28,15 +28,16 @@ require ( github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/stretchr/objx v0.5.0 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect - golang.org/x/crypto v0.12.0 // indirect - golang.org/x/exp v0.0.0-20230810033253-352e893a4cad // indirect - golang.org/x/mod v0.11.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + golang.org/x/mod v0.12.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/tools v0.9.1 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/tools v0.13.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 0a58dd7..80a5d3f 100644 --- a/go.sum +++ b/go.sum @@ -4,12 +4,12 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= -github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= +github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= +github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bits-and-blooms/bitset v1.5.0 h1:NpE8frKRLGHIcEzkR+gZhiioW1+WbYV6fKwD6ZIpQT8= -github.com/bits-and-blooms/bitset v1.5.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= +github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= @@ -22,18 +22,21 @@ github.com/cockroachdb/errors v1.8.1 h1:A5+txlVZfOqFBDa4mGz2bUWSp0aHElvHX2bKkdbQ github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06 h1:T+Np/xtzIjYM/P5NAw0e2Rf1FGvzDau1h54MKvx8G7w= -github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= +github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= +github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.10.0 h1:zRh22SR7o4K35SoNqouS9J/TKHTyU2QWaj5ldehyXtA= -github.com/consensys/gnark-crypto v0.10.0/go.mod h1:Iq/P3HHl0ElSjsg2E1gsMwhAyxnxoKK5nVyZKd+/KhU= -github.com/crate-crypto/go-kzg-4844 v0.3.0 h1:UBlWE0CgyFqqzTI+IFyCzA7A3Zw4iip6uzRv5NIXG0A= -github.com/crate-crypto/go-kzg-4844 v0.3.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4= +github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= +github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= +github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= +github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= +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/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= @@ -42,10 +45,10 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/ethereum/c-kzg-4844 v0.3.1 h1:sR65+68+WdnMKxseNWxSJuAv2tsUrihTpVBTfM/U5Zg= -github.com/ethereum/c-kzg-4844 v0.3.1/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.0 h1:dZALM0PlDTtNITTECPiqSrFo0iEYVDfby+mSVc0LxIs= -github.com/ethereum/go-ethereum v1.13.0/go.mod h1:0TDsBNJ7j8jR01vKpk4j2zfVKyAbQuKzy6wLwb5ZMuU= +github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= +github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/go-ethereum v1.13.5 h1:U6TCRciCqZRe4FPXmy1sMGxTfuk8P7u2UoinF3VbaFk= +github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= @@ -58,8 +61,8 @@ github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= @@ -77,16 +80,16 @@ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7Bd github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= @@ -106,12 +109,20 @@ github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuI github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= @@ -124,29 +135,32 @@ github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+F github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/exp v0.0.0-20230810033253-352e893a4cad h1:g0bG7Z4uG+OgH2QDODnjp6ggkk1bJDsINcuWmJN1iJU= -golang.org/x/exp v0.0.0-20230810033253-352e893a4cad/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= -golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= diff --git a/pkg/builder/exchange_order_builder.go b/pkg/builder/exchange_order_builder.go index 56e6a4c..169b80d 100644 --- a/pkg/builder/exchange_order_builder.go +++ b/pkg/builder/exchange_order_builder.go @@ -6,6 +6,7 @@ import ( "github.com/polymarket/go-order-utils/pkg/model" ) +//go:generate mockery --name ExchangeOrderBuilder type ExchangeOrderBuilder interface { // build an order object including the signature. // @@ -14,7 +15,7 @@ type ExchangeOrderBuilder interface { // @param orderData // // @returns a SignedOrder object (order + signature) - BuildSignedOrder(privateKey *ecdsa.PrivateKey, orderData *model.OrderData) (*model.SignedOrder, error) + BuildSignedOrder(privateKey *ecdsa.PrivateKey, orderData *model.OrderData, contract model.VerifyingContract) (*model.SignedOrder, error) // Creates an Order object from order data. // @@ -28,7 +29,7 @@ type ExchangeOrderBuilder interface { // @param Order // // @returns a OrderHash that is a 'common.Hash' - BuildOrderHash(order *model.Order) (model.OrderHash, error) + BuildOrderHash(order *model.Order, contract model.VerifyingContract) (model.OrderHash, error) // signs an order // diff --git a/pkg/builder/exchange_order_builder_impl.go b/pkg/builder/exchange_order_builder_impl.go index a46f643..60f5c75 100644 --- a/pkg/builder/exchange_order_builder_impl.go +++ b/pkg/builder/exchange_order_builder_impl.go @@ -6,7 +6,6 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" - "github.com/polymarket/go-order-utils/pkg/config" "github.com/polymarket/go-order-utils/pkg/eip712" "github.com/polymarket/go-order-utils/pkg/model" "github.com/polymarket/go-order-utils/pkg/signer" @@ -37,13 +36,13 @@ func NewExchangeOrderBuilderImpl(chainId *big.Int, saltGenerator func() int64) * // @param orderData // // @returns a SignedOrder object (order + signature) -func (e *ExchangeOrderBuilderImpl) BuildSignedOrder(privateKey *ecdsa.PrivateKey, orderData *model.OrderData) (*model.SignedOrder, error) { +func (e *ExchangeOrderBuilderImpl) BuildSignedOrder(privateKey *ecdsa.PrivateKey, orderData *model.OrderData, contract model.VerifyingContract) (*model.SignedOrder, error) { order, err := e.BuildOrder(orderData) if err != nil { return nil, err } - orderHash, err := e.BuildOrderHash(order) + orderHash, err := e.BuildOrderHash(order, contract) if err != nil { return nil, err } @@ -135,13 +134,13 @@ func (e *ExchangeOrderBuilderImpl) BuildOrder(orderData *model.OrderData) (*mode // @param Order // // @returns a OrderHash that is a 'common.Hash' -func (e *ExchangeOrderBuilderImpl) BuildOrderHash(order *model.Order) (model.OrderHash, error) { - contracts, err := config.GetContracts(e.chainId.Int64()) +func (e *ExchangeOrderBuilderImpl) BuildOrderHash(order *model.Order, contract model.VerifyingContract) (model.OrderHash, error) { + verifyingContract, err := utils.GetVerifyingContractAddress(e.chainId, contract) if err != nil { return model.OrderHash{}, err } - domainSeparator, err := eip712.BuildEIP712DomainSeparator(_PROTOCOL_NAME, _PROTOCOL_VERSION, e.chainId, contracts.Exchange) + domainSeparator, err := eip712.BuildEIP712DomainSeparator(_PROTOCOL_NAME, _PROTOCOL_VERSION, e.chainId, verifyingContract) if err != nil { return model.OrderHash{}, err } diff --git a/pkg/builder/exchange_order_builder_impl_test.go b/pkg/builder/exchange_order_builder_impl_test.go index a825713..03a5cf6 100644 --- a/pkg/builder/exchange_order_builder_impl_test.go +++ b/pkg/builder/exchange_order_builder_impl_test.go @@ -82,6 +82,7 @@ func TestBuildOrder(t *testing.T) { } func TestBuildOrderHash(t *testing.T) { + // FEE // random salt builder := NewExchangeOrderBuilderImpl(chainId, nil) @@ -98,7 +99,7 @@ func TestBuildOrderHash(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err := builder.BuildOrderHash(order) + orderHash, err := builder.BuildOrderHash(order, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -118,15 +119,60 @@ func TestBuildOrderHash(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err = builder.BuildOrderHash(order) + orderHash, err = builder.BuildOrderHash(order, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) expectedOrderHash := common.Hex2Bytes("bf58957703791db2ab057528d03d1cff5375d9a475b14a9073bb7d892398dc96") assert.Equal(t, expectedOrderHash, orderHash[:]) + + // NegRisk + // random salt + builder = NewExchangeOrderBuilderImpl(chainId, nil) + + order, err = builder.BuildOrder(&model.OrderData{ + Maker: signerAddress.Hex(), + Taker: common.HexToAddress("0x0").Hex(), + TokenId: "1234", + MakerAmount: "100000000", + TakerAmount: "50000000", + Side: model.BUY, + FeeRateBps: "100", + Nonce: "0", + }) + assert.NoError(t, err) + assert.NotNil(t, order) + + orderHash, err = builder.BuildOrderHash(order, model.NegRiskCTFExchange) + assert.NoError(t, err) + assert.NotNil(t, orderHash) + + // specific salt + builder = NewExchangeOrderBuilderImpl(chainId, func() int64 { return salt }) + + order, err = builder.BuildOrder(&model.OrderData{ + Maker: signerAddress.Hex(), + Taker: common.HexToAddress("0x0").Hex(), + TokenId: "1234", + MakerAmount: "100000000", + TakerAmount: "50000000", + Side: model.BUY, + FeeRateBps: "100", + Nonce: "0", + }) + assert.NoError(t, err) + assert.NotNil(t, order) + + orderHash, err = builder.BuildOrderHash(order, model.NegRiskCTFExchange) + assert.NoError(t, err) + assert.NotNil(t, orderHash) + + expectedOrderHash = common.Hex2Bytes("053c3169ec6c9e99e3640cb12b9c9245917daf36bd4fd39ea09d201a07b53952") + assert.Equal(t, expectedOrderHash, orderHash[:]) } func TestBuildOrderSignature(t *testing.T) { + // FEE // random salt builder := NewExchangeOrderBuilderImpl(chainId, nil) @@ -143,7 +189,7 @@ func TestBuildOrderSignature(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err := builder.BuildOrderHash(order) + orderHash, err := builder.BuildOrderHash(order, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -167,7 +213,7 @@ func TestBuildOrderSignature(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err = builder.BuildOrderHash(order) + orderHash, err = builder.BuildOrderHash(order, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -177,9 +223,62 @@ func TestBuildOrderSignature(t *testing.T) { expectedSignature := common.Hex2Bytes("3874d2cfe79c0e82577f4f76ec58d950522ee5923a6f08441927d382c8178a5a2190fd4d5c49705e94d75999a58ec843f94a432e87ebc15cdb2186d315b3cc201b") assert.Equal(t, expectedSignature, orderSignature) + + // NegRisk + // random salt + builder = NewExchangeOrderBuilderImpl(chainId, nil) + + order, err = builder.BuildOrder(&model.OrderData{ + Maker: signerAddress.Hex(), + Taker: common.HexToAddress("0x0").Hex(), + TokenId: "1234", + MakerAmount: "100000000", + TakerAmount: "50000000", + Side: model.BUY, + FeeRateBps: "100", + Nonce: "0", + }) + assert.NoError(t, err) + assert.NotNil(t, order) + + orderHash, err = builder.BuildOrderHash(order, model.NegRiskCTFExchange) + assert.NoError(t, err) + assert.NotNil(t, orderHash) + + orderSignature, err = builder.BuildOrderSignature(privateKey, orderHash) + assert.NoError(t, err) + assert.NotNil(t, orderSignature) + + // specific salt + builder = NewExchangeOrderBuilderImpl(chainId, func() int64 { return salt }) + + order, err = builder.BuildOrder(&model.OrderData{ + Maker: signerAddress.Hex(), + Taker: common.HexToAddress("0x0").Hex(), + TokenId: "1234", + MakerAmount: "100000000", + TakerAmount: "50000000", + Side: model.BUY, + FeeRateBps: "100", + Nonce: "0", + }) + assert.NoError(t, err) + assert.NotNil(t, order) + + orderHash, err = builder.BuildOrderHash(order, model.NegRiskCTFExchange) + assert.NoError(t, err) + assert.NotNil(t, orderHash) + + orderSignature, err = builder.BuildOrderSignature(privateKey, orderHash) + assert.NoError(t, err) + assert.NotNil(t, orderSignature) + + expectedSignature = common.Hex2Bytes("b47e588cfb8630ffa255d1a04a4bb2b996967c2143fc107ab443282ed7dcc123288842968fa29e6f2e789e39ea02f13654d4dd55002b8672e9a91e2ba9045aa21b") + assert.Equal(t, expectedSignature, orderSignature) } func TestBuildSignedOrder(t *testing.T) { + // FEE // random salt builder := NewExchangeOrderBuilderImpl(chainId, nil) @@ -192,7 +291,7 @@ func TestBuildSignedOrder(t *testing.T) { Side: model.BUY, FeeRateBps: "100", Nonce: "0", - }) + }, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, signedOrder) @@ -222,7 +321,7 @@ func TestBuildSignedOrder(t *testing.T) { Side: model.BUY, FeeRateBps: "100", Nonce: "0", - }) + }, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, signedOrder) @@ -241,4 +340,67 @@ func TestBuildSignedOrder(t *testing.T) { expectedSignature := common.Hex2Bytes("3874d2cfe79c0e82577f4f76ec58d950522ee5923a6f08441927d382c8178a5a2190fd4d5c49705e94d75999a58ec843f94a432e87ebc15cdb2186d315b3cc201b") assert.Equal(t, expectedSignature, signedOrder.Signature) + + // NegRisk + // random salt + builder = NewExchangeOrderBuilderImpl(chainId, nil) + + signedOrder, err = builder.BuildSignedOrder(privateKey, &model.OrderData{ + Maker: signerAddress.Hex(), + Taker: common.HexToAddress("0x0").Hex(), + TokenId: "1234", + MakerAmount: "100000000", + TakerAmount: "50000000", + Side: model.BUY, + FeeRateBps: "100", + Nonce: "0", + }, model.NegRiskCTFExchange) + assert.NoError(t, err) + assert.NotNil(t, signedOrder) + + assert.True(t, signedOrder.Salt.Int64() > 0) + assert.Equal(t, signedOrder.Maker, signerAddress) + assert.Equal(t, signedOrder.Signer, signerAddress) + assert.Equal(t, signedOrder.TokenId.String(), "1234") + assert.Equal(t, signedOrder.MakerAmount.String(), "100000000") + assert.Equal(t, signedOrder.TakerAmount.String(), "50000000") + assert.Equal(t, signedOrder.Side.String(), "0") + assert.Equal(t, signedOrder.Expiration.String(), "0") + assert.Equal(t, signedOrder.Nonce.String(), "0") + assert.Equal(t, signedOrder.FeeRateBps.String(), "100") + assert.Equal(t, signedOrder.SignatureType.String(), "0") + assert.NotEmpty(t, signedOrder.Signature) + assert.NotEmpty(t, hex.EncodeToString(signedOrder.Signature)) + + // specific salt + builder = NewExchangeOrderBuilderImpl(chainId, func() int64 { return salt }) + + signedOrder, err = builder.BuildSignedOrder(privateKey, &model.OrderData{ + Maker: signerAddress.Hex(), + Taker: common.HexToAddress("0x0").Hex(), + TokenId: "1234", + MakerAmount: "100000000", + TakerAmount: "50000000", + Side: model.BUY, + FeeRateBps: "100", + Nonce: "0", + }, model.NegRiskCTFExchange) + assert.NoError(t, err) + assert.NotNil(t, signedOrder) + + assert.Equal(t, signedOrder.Salt.Int64(), salt) + assert.Equal(t, signedOrder.Maker, signerAddress) + assert.Equal(t, signedOrder.Signer, signerAddress) + assert.Equal(t, signedOrder.TokenId.String(), "1234") + assert.Equal(t, signedOrder.MakerAmount.String(), "100000000") + assert.Equal(t, signedOrder.TakerAmount.String(), "50000000") + assert.Equal(t, signedOrder.Side.String(), "0") + assert.Equal(t, signedOrder.Expiration.String(), "0") + assert.Equal(t, signedOrder.Nonce.String(), "0") + assert.Equal(t, signedOrder.FeeRateBps.String(), "100") + assert.Equal(t, signedOrder.SignatureType.String(), "0") + assert.NotEmpty(t, hex.EncodeToString(signedOrder.Signature)) + + expectedSignature = common.Hex2Bytes("b47e588cfb8630ffa255d1a04a4bb2b996967c2143fc107ab443282ed7dcc123288842968fa29e6f2e789e39ea02f13654d4dd55002b8672e9a91e2ba9045aa21b") + assert.Equal(t, expectedSignature, signedOrder.Signature) } diff --git a/pkg/builder/mocks/ExchangeOrderBuilder.go b/pkg/builder/mocks/ExchangeOrderBuilder.go new file mode 100644 index 0000000..26fb26b --- /dev/null +++ b/pkg/builder/mocks/ExchangeOrderBuilder.go @@ -0,0 +1,136 @@ +// Code generated by mockery v2.36.1. DO NOT EDIT. + +package mocks + +import ( + ecdsa "crypto/ecdsa" + + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + model "github.com/polymarket/go-order-utils/pkg/model" +) + +// ExchangeOrderBuilder is an autogenerated mock type for the ExchangeOrderBuilder type +type ExchangeOrderBuilder struct { + mock.Mock +} + +// BuildOrder provides a mock function with given fields: orderData +func (_m *ExchangeOrderBuilder) BuildOrder(orderData *model.OrderData) (*model.Order, error) { + ret := _m.Called(orderData) + + var r0 *model.Order + var r1 error + if rf, ok := ret.Get(0).(func(*model.OrderData) (*model.Order, error)); ok { + return rf(orderData) + } + if rf, ok := ret.Get(0).(func(*model.OrderData) *model.Order); ok { + r0 = rf(orderData) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Order) + } + } + + if rf, ok := ret.Get(1).(func(*model.OrderData) error); ok { + r1 = rf(orderData) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BuildOrderHash provides a mock function with given fields: order, contract +func (_m *ExchangeOrderBuilder) BuildOrderHash(order *model.Order, contract int) (common.Hash, error) { + ret := _m.Called(order, contract) + + var r0 common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(*model.Order, int) (common.Hash, error)); ok { + return rf(order, contract) + } + if rf, ok := ret.Get(0).(func(*model.Order, int) common.Hash); ok { + r0 = rf(order, contract) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Hash) + } + } + + if rf, ok := ret.Get(1).(func(*model.Order, int) error); ok { + r1 = rf(order, contract) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BuildOrderSignature provides a mock function with given fields: privateKey, orderHash +func (_m *ExchangeOrderBuilder) BuildOrderSignature(privateKey *ecdsa.PrivateKey, orderHash common.Hash) ([]byte, error) { + ret := _m.Called(privateKey, orderHash) + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(*ecdsa.PrivateKey, common.Hash) ([]byte, error)); ok { + return rf(privateKey, orderHash) + } + if rf, ok := ret.Get(0).(func(*ecdsa.PrivateKey, common.Hash) []byte); ok { + r0 = rf(privateKey, orderHash) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(*ecdsa.PrivateKey, common.Hash) error); ok { + r1 = rf(privateKey, orderHash) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BuildSignedOrder provides a mock function with given fields: privateKey, orderData, contract +func (_m *ExchangeOrderBuilder) BuildSignedOrder(privateKey *ecdsa.PrivateKey, orderData *model.OrderData, contract int) (*model.SignedOrder, error) { + ret := _m.Called(privateKey, orderData, contract) + + var r0 *model.SignedOrder + var r1 error + if rf, ok := ret.Get(0).(func(*ecdsa.PrivateKey, *model.OrderData, int) (*model.SignedOrder, error)); ok { + return rf(privateKey, orderData, contract) + } + if rf, ok := ret.Get(0).(func(*ecdsa.PrivateKey, *model.OrderData, int) *model.SignedOrder); ok { + r0 = rf(privateKey, orderData, contract) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.SignedOrder) + } + } + + if rf, ok := ret.Get(1).(func(*ecdsa.PrivateKey, *model.OrderData, int) error); ok { + r1 = rf(privateKey, orderData, contract) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewExchangeOrderBuilder creates a new instance of ExchangeOrderBuilder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExchangeOrderBuilder(t interface { + mock.TestingT + Cleanup(func()) +}) *ExchangeOrderBuilder { + mock := &ExchangeOrderBuilder{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/config/config.go b/pkg/config/config.go index a3a4a7e..c9e8081 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -7,26 +7,35 @@ import ( ) type Contracts struct { - Exchange common.Address - FeeModule common.Address - Collateral common.Address - Conditional common.Address + Exchange common.Address + FeeModule common.Address + NegRiskExchange common.Address + NegRiskFeeModule common.Address + NegRiskAdapter common.Address + Collateral common.Address + Conditional common.Address } func GetContracts(chainId int64) (*Contracts, error) { var ( MUMBAI_CONTRACTS = &Contracts{ - Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"), - FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"), - Collateral: common.HexToAddress("0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961"), - Conditional: common.HexToAddress("0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43"), + Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"), + FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"), + NegRiskExchange: common.HexToAddress("0x87d1A0DdB4C63a6301916F02090A51a7241571e4"), + NegRiskFeeModule: common.HexToAddress("0x311FD94978961EeF4B903519B33B47B506aB6823"), + NegRiskAdapter: common.HexToAddress("0x9A6930BB811fe3dFE1c35e4502134B38EC54399C"), + Collateral: common.HexToAddress("0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961"), + Conditional: common.HexToAddress("0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43"), } MATIC_CONTRACTS = &Contracts{ - Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"), - FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"), - Collateral: common.HexToAddress("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"), - Conditional: common.HexToAddress("0x4D97DCd97eC945f40cF65F87097ACe5EA0476045"), + Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"), + FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"), + NegRiskExchange: common.HexToAddress("0xC5d563A36AE78145C45a50134d48A1215220f80a"), + NegRiskFeeModule: common.HexToAddress("0x78769D50Be1763ed1CA0D5E878D93f05aabff29e"), + NegRiskAdapter: common.HexToAddress("0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296"), + Collateral: common.HexToAddress("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"), + Conditional: common.HexToAddress("0x4D97DCd97eC945f40cF65F87097ACe5EA0476045"), } ) diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 07a7841..81fcf13 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -11,17 +11,23 @@ import ( func TestGetContracts(t *testing.T) { var ( mumbai = &Contracts{ - Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"), - FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"), - Collateral: common.HexToAddress("0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961"), - Conditional: common.HexToAddress("0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43"), + Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"), + FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"), + Collateral: common.HexToAddress("0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961"), + Conditional: common.HexToAddress("0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43"), + NegRiskFeeModule: common.HexToAddress("0x311FD94978961EeF4B903519B33B47B506aB6823"), + NegRiskExchange: common.HexToAddress("0x87d1A0DdB4C63a6301916F02090A51a7241571e4"), + NegRiskAdapter: common.HexToAddress("0x9A6930BB811fe3dFE1c35e4502134B38EC54399C"), } matic = &Contracts{ - Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"), - FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"), - Collateral: common.HexToAddress("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"), - Conditional: common.HexToAddress("0x4D97DCd97eC945f40cF65F87097ACe5EA0476045"), + Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"), + FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"), + Collateral: common.HexToAddress("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"), + Conditional: common.HexToAddress("0x4D97DCd97eC945f40cF65F87097ACe5EA0476045"), + NegRiskFeeModule: common.HexToAddress("0x78769D50Be1763ed1CA0D5E878D93f05aabff29e"), + NegRiskExchange: common.HexToAddress("0xC5d563A36AE78145C45a50134d48A1215220f80a"), + NegRiskAdapter: common.HexToAddress("0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296"), } ) @@ -32,6 +38,9 @@ func TestGetContracts(t *testing.T) { assert.True(t, bytes.Equal(c.FeeModule[:], mumbai.FeeModule[:])) assert.True(t, bytes.Equal(c.Collateral[:], mumbai.Collateral[:])) assert.True(t, bytes.Equal(c.Conditional[:], mumbai.Conditional[:])) + assert.True(t, bytes.Equal(c.NegRiskFeeModule[:], mumbai.NegRiskFeeModule[:])) + assert.True(t, bytes.Equal(c.NegRiskExchange[:], mumbai.NegRiskExchange[:])) + assert.True(t, bytes.Equal(c.NegRiskAdapter[:], mumbai.NegRiskAdapter[:])) c, err = GetContracts(137) assert.NotNil(t, c) @@ -40,6 +49,9 @@ func TestGetContracts(t *testing.T) { assert.True(t, bytes.Equal(c.FeeModule[:], matic.FeeModule[:])) assert.True(t, bytes.Equal(c.Collateral[:], matic.Collateral[:])) assert.True(t, bytes.Equal(c.Conditional[:], matic.Conditional[:])) + assert.True(t, bytes.Equal(c.NegRiskFeeModule[:], matic.NegRiskFeeModule[:])) + assert.True(t, bytes.Equal(c.NegRiskExchange[:], matic.NegRiskExchange[:])) + assert.True(t, bytes.Equal(c.NegRiskAdapter[:], matic.NegRiskAdapter[:])) c, err = GetContracts(100000) assert.Nil(t, c) diff --git a/pkg/contracts/exchange-fees/exchange-fees.go b/pkg/contracts/exchange-fees/exchange_fees.go similarity index 71% rename from pkg/contracts/exchange-fees/exchange-fees.go rename to pkg/contracts/exchange-fees/exchange_fees.go index 8d2af9f..4febae8 100644 --- a/pkg/contracts/exchange-fees/exchange-fees.go +++ b/pkg/contracts/exchange-fees/exchange_fees.go @@ -26,6 +26,7 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // Order is an auto generated low-level Go binding around an user-defined struct. @@ -45,163 +46,163 @@ type Order struct { Signature []byte } -// ExchangefeesMetaData contains all meta data concerning the Exchangefees contract. -var ExchangefeesMetaData = &bind.MetaData{ +// ExchangeFeesMetaData contains all meta data concerning the ExchangeFees contract. +var ExchangeFeesMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_exchange\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"NotAdmin\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeeRefunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeeWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdminAddress\",\"type\":\"address\"}],\"name\":\"NewAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedAdmin\",\"type\":\"address\"}],\"name\":\"RemovedAdmin\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"addAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"admins\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"collateral\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ctf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"exchange\",\"outputs\":[{\"internalType\":\"contractIExchange\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"takerOrder\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"makerOrders\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"takerFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"makerFillAmounts\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"makerFeeRate\",\"type\":\"uint256\"}],\"name\":\"matchOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"removeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } -// ExchangefeesABI is the input ABI used to generate the binding from. -// Deprecated: Use ExchangefeesMetaData.ABI instead. -var ExchangefeesABI = ExchangefeesMetaData.ABI +// ExchangeFeesABI is the input ABI used to generate the binding from. +// Deprecated: Use ExchangeFeesMetaData.ABI instead. +var ExchangeFeesABI = ExchangeFeesMetaData.ABI -// Exchangefees is an auto generated Go binding around an Ethereum contract. -type Exchangefees struct { - ExchangefeesCaller // Read-only binding to the contract - ExchangefeesTransactor // Write-only binding to the contract - ExchangefeesFilterer // Log filterer for contract events +// ExchangeFees is an auto generated Go binding around an Ethereum contract. +type ExchangeFees struct { + ExchangeFeesCaller // Read-only binding to the contract + ExchangeFeesTransactor // Write-only binding to the contract + ExchangeFeesFilterer // Log filterer for contract events } -// ExchangefeesCaller is an auto generated read-only Go binding around an Ethereum contract. -type ExchangefeesCaller struct { +// ExchangeFeesCaller is an auto generated read-only Go binding around an Ethereum contract. +type ExchangeFeesCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } -// ExchangefeesTransactor is an auto generated write-only Go binding around an Ethereum contract. -type ExchangefeesTransactor struct { +// ExchangeFeesTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ExchangeFeesTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } -// ExchangefeesFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ExchangefeesFilterer struct { +// ExchangeFeesFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ExchangeFeesFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } -// ExchangefeesSession is an auto generated Go binding around an Ethereum contract, +// ExchangeFeesSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. -type ExchangefeesSession struct { - Contract *Exchangefees // Generic contract binding to set the session for +type ExchangeFeesSession struct { + Contract *ExchangeFees // 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 } -// ExchangefeesCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// ExchangeFeesCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. -type ExchangefeesCallerSession struct { - Contract *ExchangefeesCaller // Generic contract caller binding to set the session for +type ExchangeFeesCallerSession struct { + Contract *ExchangeFeesCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } -// ExchangefeesTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// ExchangeFeesTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. -type ExchangefeesTransactorSession struct { - Contract *ExchangefeesTransactor // Generic contract transactor binding to set the session for +type ExchangeFeesTransactorSession struct { + Contract *ExchangeFeesTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } -// ExchangefeesRaw is an auto generated low-level Go binding around an Ethereum contract. -type ExchangefeesRaw struct { - Contract *Exchangefees // Generic contract binding to access the raw methods on +// ExchangeFeesRaw is an auto generated low-level Go binding around an Ethereum contract. +type ExchangeFeesRaw struct { + Contract *ExchangeFees // Generic contract binding to access the raw methods on } -// ExchangefeesCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ExchangefeesCallerRaw struct { - Contract *ExchangefeesCaller // Generic read-only contract binding to access the raw methods on +// ExchangeFeesCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ExchangeFeesCallerRaw struct { + Contract *ExchangeFeesCaller // Generic read-only contract binding to access the raw methods on } -// ExchangefeesTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ExchangefeesTransactorRaw struct { - Contract *ExchangefeesTransactor // Generic write-only contract binding to access the raw methods on +// ExchangeFeesTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ExchangeFeesTransactorRaw struct { + Contract *ExchangeFeesTransactor // Generic write-only contract binding to access the raw methods on } -// NewExchangefees creates a new instance of Exchangefees, bound to a specific deployed contract. -func NewExchangefees(address common.Address, backend bind.ContractBackend) (*Exchangefees, error) { - contract, err := bindExchangefees(address, backend, backend, backend) +// NewExchangeFees creates a new instance of ExchangeFees, bound to a specific deployed contract. +func NewExchangeFees(address common.Address, backend bind.ContractBackend) (*ExchangeFees, error) { + contract, err := bindExchangeFees(address, backend, backend, backend) if err != nil { return nil, err } - return &Exchangefees{ExchangefeesCaller: ExchangefeesCaller{contract: contract}, ExchangefeesTransactor: ExchangefeesTransactor{contract: contract}, ExchangefeesFilterer: ExchangefeesFilterer{contract: contract}}, nil + return &ExchangeFees{ExchangeFeesCaller: ExchangeFeesCaller{contract: contract}, ExchangeFeesTransactor: ExchangeFeesTransactor{contract: contract}, ExchangeFeesFilterer: ExchangeFeesFilterer{contract: contract}}, nil } -// NewExchangefeesCaller creates a new read-only instance of Exchangefees, bound to a specific deployed contract. -func NewExchangefeesCaller(address common.Address, caller bind.ContractCaller) (*ExchangefeesCaller, error) { - contract, err := bindExchangefees(address, caller, nil, nil) +// NewExchangeFeesCaller creates a new read-only instance of ExchangeFees, bound to a specific deployed contract. +func NewExchangeFeesCaller(address common.Address, caller bind.ContractCaller) (*ExchangeFeesCaller, error) { + contract, err := bindExchangeFees(address, caller, nil, nil) if err != nil { return nil, err } - return &ExchangefeesCaller{contract: contract}, nil + return &ExchangeFeesCaller{contract: contract}, nil } -// NewExchangefeesTransactor creates a new write-only instance of Exchangefees, bound to a specific deployed contract. -func NewExchangefeesTransactor(address common.Address, transactor bind.ContractTransactor) (*ExchangefeesTransactor, error) { - contract, err := bindExchangefees(address, nil, transactor, nil) +// NewExchangeFeesTransactor creates a new write-only instance of ExchangeFees, bound to a specific deployed contract. +func NewExchangeFeesTransactor(address common.Address, transactor bind.ContractTransactor) (*ExchangeFeesTransactor, error) { + contract, err := bindExchangeFees(address, nil, transactor, nil) if err != nil { return nil, err } - return &ExchangefeesTransactor{contract: contract}, nil + return &ExchangeFeesTransactor{contract: contract}, nil } -// NewExchangefeesFilterer creates a new log filterer instance of Exchangefees, bound to a specific deployed contract. -func NewExchangefeesFilterer(address common.Address, filterer bind.ContractFilterer) (*ExchangefeesFilterer, error) { - contract, err := bindExchangefees(address, nil, nil, filterer) +// NewExchangeFeesFilterer creates a new log filterer instance of ExchangeFees, bound to a specific deployed contract. +func NewExchangeFeesFilterer(address common.Address, filterer bind.ContractFilterer) (*ExchangeFeesFilterer, error) { + contract, err := bindExchangeFees(address, nil, nil, filterer) if err != nil { return nil, err } - return &ExchangefeesFilterer{contract: contract}, nil + return &ExchangeFeesFilterer{contract: contract}, nil } -// bindExchangefees binds a generic wrapper to an already deployed contract. -func bindExchangefees(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(ExchangefeesABI)) +// bindExchangeFees binds a generic wrapper to an already deployed contract. +func bindExchangeFees(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ExchangeFeesMetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + 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 (_Exchangefees *ExchangefeesRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Exchangefees.Contract.ExchangefeesCaller.contract.Call(opts, result, method, params...) +func (_ExchangeFees *ExchangeFeesRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ExchangeFees.Contract.ExchangeFeesCaller.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 (_Exchangefees *ExchangefeesRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Exchangefees.Contract.ExchangefeesTransactor.contract.Transfer(opts) +func (_ExchangeFees *ExchangeFeesRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ExchangeFees.Contract.ExchangeFeesTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. -func (_Exchangefees *ExchangefeesRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Exchangefees.Contract.ExchangefeesTransactor.contract.Transact(opts, method, params...) +func (_ExchangeFees *ExchangeFeesRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ExchangeFees.Contract.ExchangeFeesTransactor.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 (_Exchangefees *ExchangefeesCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Exchangefees.Contract.contract.Call(opts, result, method, params...) +func (_ExchangeFees *ExchangeFeesCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ExchangeFees.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 (_Exchangefees *ExchangefeesTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Exchangefees.Contract.contract.Transfer(opts) +func (_ExchangeFees *ExchangeFeesTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ExchangeFees.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. -func (_Exchangefees *ExchangefeesTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Exchangefees.Contract.contract.Transact(opts, method, params...) +func (_ExchangeFees *ExchangeFeesTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ExchangeFees.Contract.contract.Transact(opts, method, params...) } // Admins is a free data retrieval call binding the contract method 0x429b62e5. // // Solidity: function admins(address ) view returns(uint256) -func (_Exchangefees *ExchangefeesCaller) Admins(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { +func (_ExchangeFees *ExchangeFeesCaller) Admins(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { var out []interface{} - err := _Exchangefees.contract.Call(opts, &out, "admins", arg0) + err := _ExchangeFees.contract.Call(opts, &out, "admins", arg0) if err != nil { return *new(*big.Int), err @@ -216,23 +217,23 @@ func (_Exchangefees *ExchangefeesCaller) Admins(opts *bind.CallOpts, arg0 common // Admins is a free data retrieval call binding the contract method 0x429b62e5. // // Solidity: function admins(address ) view returns(uint256) -func (_Exchangefees *ExchangefeesSession) Admins(arg0 common.Address) (*big.Int, error) { - return _Exchangefees.Contract.Admins(&_Exchangefees.CallOpts, arg0) +func (_ExchangeFees *ExchangeFeesSession) Admins(arg0 common.Address) (*big.Int, error) { + return _ExchangeFees.Contract.Admins(&_ExchangeFees.CallOpts, arg0) } // Admins is a free data retrieval call binding the contract method 0x429b62e5. // // Solidity: function admins(address ) view returns(uint256) -func (_Exchangefees *ExchangefeesCallerSession) Admins(arg0 common.Address) (*big.Int, error) { - return _Exchangefees.Contract.Admins(&_Exchangefees.CallOpts, arg0) +func (_ExchangeFees *ExchangeFeesCallerSession) Admins(arg0 common.Address) (*big.Int, error) { + return _ExchangeFees.Contract.Admins(&_ExchangeFees.CallOpts, arg0) } // Collateral is a free data retrieval call binding the contract method 0xd8dfeb45. // // Solidity: function collateral() view returns(address) -func (_Exchangefees *ExchangefeesCaller) Collateral(opts *bind.CallOpts) (common.Address, error) { +func (_ExchangeFees *ExchangeFeesCaller) Collateral(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _Exchangefees.contract.Call(opts, &out, "collateral") + err := _ExchangeFees.contract.Call(opts, &out, "collateral") if err != nil { return *new(common.Address), err @@ -247,23 +248,23 @@ func (_Exchangefees *ExchangefeesCaller) Collateral(opts *bind.CallOpts) (common // Collateral is a free data retrieval call binding the contract method 0xd8dfeb45. // // Solidity: function collateral() view returns(address) -func (_Exchangefees *ExchangefeesSession) Collateral() (common.Address, error) { - return _Exchangefees.Contract.Collateral(&_Exchangefees.CallOpts) +func (_ExchangeFees *ExchangeFeesSession) Collateral() (common.Address, error) { + return _ExchangeFees.Contract.Collateral(&_ExchangeFees.CallOpts) } // Collateral is a free data retrieval call binding the contract method 0xd8dfeb45. // // Solidity: function collateral() view returns(address) -func (_Exchangefees *ExchangefeesCallerSession) Collateral() (common.Address, error) { - return _Exchangefees.Contract.Collateral(&_Exchangefees.CallOpts) +func (_ExchangeFees *ExchangeFeesCallerSession) Collateral() (common.Address, error) { + return _ExchangeFees.Contract.Collateral(&_ExchangeFees.CallOpts) } // Ctf is a free data retrieval call binding the contract method 0x22a9339f. // // Solidity: function ctf() view returns(address) -func (_Exchangefees *ExchangefeesCaller) Ctf(opts *bind.CallOpts) (common.Address, error) { +func (_ExchangeFees *ExchangeFeesCaller) Ctf(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _Exchangefees.contract.Call(opts, &out, "ctf") + err := _ExchangeFees.contract.Call(opts, &out, "ctf") if err != nil { return *new(common.Address), err @@ -278,23 +279,23 @@ func (_Exchangefees *ExchangefeesCaller) Ctf(opts *bind.CallOpts) (common.Addres // Ctf is a free data retrieval call binding the contract method 0x22a9339f. // // Solidity: function ctf() view returns(address) -func (_Exchangefees *ExchangefeesSession) Ctf() (common.Address, error) { - return _Exchangefees.Contract.Ctf(&_Exchangefees.CallOpts) +func (_ExchangeFees *ExchangeFeesSession) Ctf() (common.Address, error) { + return _ExchangeFees.Contract.Ctf(&_ExchangeFees.CallOpts) } // Ctf is a free data retrieval call binding the contract method 0x22a9339f. // // Solidity: function ctf() view returns(address) -func (_Exchangefees *ExchangefeesCallerSession) Ctf() (common.Address, error) { - return _Exchangefees.Contract.Ctf(&_Exchangefees.CallOpts) +func (_ExchangeFees *ExchangeFeesCallerSession) Ctf() (common.Address, error) { + return _ExchangeFees.Contract.Ctf(&_ExchangeFees.CallOpts) } // Exchange is a free data retrieval call binding the contract method 0xd2f7265a. // // Solidity: function exchange() view returns(address) -func (_Exchangefees *ExchangefeesCaller) Exchange(opts *bind.CallOpts) (common.Address, error) { +func (_ExchangeFees *ExchangeFeesCaller) Exchange(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _Exchangefees.contract.Call(opts, &out, "exchange") + err := _ExchangeFees.contract.Call(opts, &out, "exchange") if err != nil { return *new(common.Address), err @@ -309,23 +310,23 @@ func (_Exchangefees *ExchangefeesCaller) Exchange(opts *bind.CallOpts) (common.A // Exchange is a free data retrieval call binding the contract method 0xd2f7265a. // // Solidity: function exchange() view returns(address) -func (_Exchangefees *ExchangefeesSession) Exchange() (common.Address, error) { - return _Exchangefees.Contract.Exchange(&_Exchangefees.CallOpts) +func (_ExchangeFees *ExchangeFeesSession) Exchange() (common.Address, error) { + return _ExchangeFees.Contract.Exchange(&_ExchangeFees.CallOpts) } // Exchange is a free data retrieval call binding the contract method 0xd2f7265a. // // Solidity: function exchange() view returns(address) -func (_Exchangefees *ExchangefeesCallerSession) Exchange() (common.Address, error) { - return _Exchangefees.Contract.Exchange(&_Exchangefees.CallOpts) +func (_ExchangeFees *ExchangeFeesCallerSession) Exchange() (common.Address, error) { + return _ExchangeFees.Contract.Exchange(&_ExchangeFees.CallOpts) } // IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. // // Solidity: function isAdmin(address addr) view returns(bool) -func (_Exchangefees *ExchangefeesCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { +func (_ExchangeFees *ExchangeFeesCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { var out []interface{} - err := _Exchangefees.contract.Call(opts, &out, "isAdmin", addr) + err := _ExchangeFees.contract.Call(opts, &out, "isAdmin", addr) if err != nil { return *new(bool), err @@ -340,167 +341,167 @@ func (_Exchangefees *ExchangefeesCaller) IsAdmin(opts *bind.CallOpts, addr commo // IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. // // Solidity: function isAdmin(address addr) view returns(bool) -func (_Exchangefees *ExchangefeesSession) IsAdmin(addr common.Address) (bool, error) { - return _Exchangefees.Contract.IsAdmin(&_Exchangefees.CallOpts, addr) +func (_ExchangeFees *ExchangeFeesSession) IsAdmin(addr common.Address) (bool, error) { + return _ExchangeFees.Contract.IsAdmin(&_ExchangeFees.CallOpts, addr) } // IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. // // Solidity: function isAdmin(address addr) view returns(bool) -func (_Exchangefees *ExchangefeesCallerSession) IsAdmin(addr common.Address) (bool, error) { - return _Exchangefees.Contract.IsAdmin(&_Exchangefees.CallOpts, addr) +func (_ExchangeFees *ExchangeFeesCallerSession) IsAdmin(addr common.Address) (bool, error) { + return _ExchangeFees.Contract.IsAdmin(&_ExchangeFees.CallOpts, addr) } // AddAdmin is a paid mutator transaction binding the contract method 0x70480275. // // Solidity: function addAdmin(address admin) returns() -func (_Exchangefees *ExchangefeesTransactor) AddAdmin(opts *bind.TransactOpts, admin common.Address) (*types.Transaction, error) { - return _Exchangefees.contract.Transact(opts, "addAdmin", admin) +func (_ExchangeFees *ExchangeFeesTransactor) AddAdmin(opts *bind.TransactOpts, admin common.Address) (*types.Transaction, error) { + return _ExchangeFees.contract.Transact(opts, "addAdmin", admin) } // AddAdmin is a paid mutator transaction binding the contract method 0x70480275. // // Solidity: function addAdmin(address admin) returns() -func (_Exchangefees *ExchangefeesSession) AddAdmin(admin common.Address) (*types.Transaction, error) { - return _Exchangefees.Contract.AddAdmin(&_Exchangefees.TransactOpts, admin) +func (_ExchangeFees *ExchangeFeesSession) AddAdmin(admin common.Address) (*types.Transaction, error) { + return _ExchangeFees.Contract.AddAdmin(&_ExchangeFees.TransactOpts, admin) } // AddAdmin is a paid mutator transaction binding the contract method 0x70480275. // // Solidity: function addAdmin(address admin) returns() -func (_Exchangefees *ExchangefeesTransactorSession) AddAdmin(admin common.Address) (*types.Transaction, error) { - return _Exchangefees.Contract.AddAdmin(&_Exchangefees.TransactOpts, admin) +func (_ExchangeFees *ExchangeFeesTransactorSession) AddAdmin(admin common.Address) (*types.Transaction, error) { + return _ExchangeFees.Contract.AddAdmin(&_ExchangeFees.TransactOpts, admin) } // MatchOrders is a paid mutator transaction binding the contract method 0xd2539b37. // // Solidity: function matchOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) takerOrder, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts, uint256 makerFeeRate) returns() -func (_Exchangefees *ExchangefeesTransactor) MatchOrders(opts *bind.TransactOpts, takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int, makerFeeRate *big.Int) (*types.Transaction, error) { - return _Exchangefees.contract.Transact(opts, "matchOrders", takerOrder, makerOrders, takerFillAmount, makerFillAmounts, makerFeeRate) +func (_ExchangeFees *ExchangeFeesTransactor) MatchOrders(opts *bind.TransactOpts, takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int, makerFeeRate *big.Int) (*types.Transaction, error) { + return _ExchangeFees.contract.Transact(opts, "matchOrders", takerOrder, makerOrders, takerFillAmount, makerFillAmounts, makerFeeRate) } // MatchOrders is a paid mutator transaction binding the contract method 0xd2539b37. // // Solidity: function matchOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) takerOrder, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts, uint256 makerFeeRate) returns() -func (_Exchangefees *ExchangefeesSession) MatchOrders(takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int, makerFeeRate *big.Int) (*types.Transaction, error) { - return _Exchangefees.Contract.MatchOrders(&_Exchangefees.TransactOpts, takerOrder, makerOrders, takerFillAmount, makerFillAmounts, makerFeeRate) +func (_ExchangeFees *ExchangeFeesSession) MatchOrders(takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int, makerFeeRate *big.Int) (*types.Transaction, error) { + return _ExchangeFees.Contract.MatchOrders(&_ExchangeFees.TransactOpts, takerOrder, makerOrders, takerFillAmount, makerFillAmounts, makerFeeRate) } // MatchOrders is a paid mutator transaction binding the contract method 0xd2539b37. // // Solidity: function matchOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) takerOrder, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts, uint256 makerFeeRate) returns() -func (_Exchangefees *ExchangefeesTransactorSession) MatchOrders(takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int, makerFeeRate *big.Int) (*types.Transaction, error) { - return _Exchangefees.Contract.MatchOrders(&_Exchangefees.TransactOpts, takerOrder, makerOrders, takerFillAmount, makerFillAmounts, makerFeeRate) +func (_ExchangeFees *ExchangeFeesTransactorSession) MatchOrders(takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int, makerFeeRate *big.Int) (*types.Transaction, error) { + return _ExchangeFees.Contract.MatchOrders(&_ExchangeFees.TransactOpts, takerOrder, makerOrders, takerFillAmount, makerFillAmounts, makerFeeRate) } // OnERC1155BatchReceived is a paid mutator transaction binding the contract method 0xbc197c81. // // Solidity: function onERC1155BatchReceived(address , address , uint256[] , uint256[] , bytes ) returns(bytes4) -func (_Exchangefees *ExchangefeesTransactor) OnERC1155BatchReceived(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { - return _Exchangefees.contract.Transact(opts, "onERC1155BatchReceived", arg0, arg1, arg2, arg3, arg4) +func (_ExchangeFees *ExchangeFeesTransactor) OnERC1155BatchReceived(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { + return _ExchangeFees.contract.Transact(opts, "onERC1155BatchReceived", arg0, arg1, arg2, arg3, arg4) } // OnERC1155BatchReceived is a paid mutator transaction binding the contract method 0xbc197c81. // // Solidity: function onERC1155BatchReceived(address , address , uint256[] , uint256[] , bytes ) returns(bytes4) -func (_Exchangefees *ExchangefeesSession) OnERC1155BatchReceived(arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { - return _Exchangefees.Contract.OnERC1155BatchReceived(&_Exchangefees.TransactOpts, arg0, arg1, arg2, arg3, arg4) +func (_ExchangeFees *ExchangeFeesSession) OnERC1155BatchReceived(arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { + return _ExchangeFees.Contract.OnERC1155BatchReceived(&_ExchangeFees.TransactOpts, arg0, arg1, arg2, arg3, arg4) } // OnERC1155BatchReceived is a paid mutator transaction binding the contract method 0xbc197c81. // // Solidity: function onERC1155BatchReceived(address , address , uint256[] , uint256[] , bytes ) returns(bytes4) -func (_Exchangefees *ExchangefeesTransactorSession) OnERC1155BatchReceived(arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { - return _Exchangefees.Contract.OnERC1155BatchReceived(&_Exchangefees.TransactOpts, arg0, arg1, arg2, arg3, arg4) +func (_ExchangeFees *ExchangeFeesTransactorSession) OnERC1155BatchReceived(arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { + return _ExchangeFees.Contract.OnERC1155BatchReceived(&_ExchangeFees.TransactOpts, arg0, arg1, arg2, arg3, arg4) } // OnERC1155Received is a paid mutator transaction binding the contract method 0xf23a6e61. // // Solidity: function onERC1155Received(address , address , uint256 , uint256 , bytes ) returns(bytes4) -func (_Exchangefees *ExchangefeesTransactor) OnERC1155Received(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { - return _Exchangefees.contract.Transact(opts, "onERC1155Received", arg0, arg1, arg2, arg3, arg4) +func (_ExchangeFees *ExchangeFeesTransactor) OnERC1155Received(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { + return _ExchangeFees.contract.Transact(opts, "onERC1155Received", arg0, arg1, arg2, arg3, arg4) } // OnERC1155Received is a paid mutator transaction binding the contract method 0xf23a6e61. // // Solidity: function onERC1155Received(address , address , uint256 , uint256 , bytes ) returns(bytes4) -func (_Exchangefees *ExchangefeesSession) OnERC1155Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { - return _Exchangefees.Contract.OnERC1155Received(&_Exchangefees.TransactOpts, arg0, arg1, arg2, arg3, arg4) +func (_ExchangeFees *ExchangeFeesSession) OnERC1155Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { + return _ExchangeFees.Contract.OnERC1155Received(&_ExchangeFees.TransactOpts, arg0, arg1, arg2, arg3, arg4) } // OnERC1155Received is a paid mutator transaction binding the contract method 0xf23a6e61. // // Solidity: function onERC1155Received(address , address , uint256 , uint256 , bytes ) returns(bytes4) -func (_Exchangefees *ExchangefeesTransactorSession) OnERC1155Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { - return _Exchangefees.Contract.OnERC1155Received(&_Exchangefees.TransactOpts, arg0, arg1, arg2, arg3, arg4) +func (_ExchangeFees *ExchangeFeesTransactorSession) OnERC1155Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { + return _ExchangeFees.Contract.OnERC1155Received(&_ExchangeFees.TransactOpts, arg0, arg1, arg2, arg3, arg4) } // RemoveAdmin is a paid mutator transaction binding the contract method 0x1785f53c. // // Solidity: function removeAdmin(address admin) returns() -func (_Exchangefees *ExchangefeesTransactor) RemoveAdmin(opts *bind.TransactOpts, admin common.Address) (*types.Transaction, error) { - return _Exchangefees.contract.Transact(opts, "removeAdmin", admin) +func (_ExchangeFees *ExchangeFeesTransactor) RemoveAdmin(opts *bind.TransactOpts, admin common.Address) (*types.Transaction, error) { + return _ExchangeFees.contract.Transact(opts, "removeAdmin", admin) } // RemoveAdmin is a paid mutator transaction binding the contract method 0x1785f53c. // // Solidity: function removeAdmin(address admin) returns() -func (_Exchangefees *ExchangefeesSession) RemoveAdmin(admin common.Address) (*types.Transaction, error) { - return _Exchangefees.Contract.RemoveAdmin(&_Exchangefees.TransactOpts, admin) +func (_ExchangeFees *ExchangeFeesSession) RemoveAdmin(admin common.Address) (*types.Transaction, error) { + return _ExchangeFees.Contract.RemoveAdmin(&_ExchangeFees.TransactOpts, admin) } // RemoveAdmin is a paid mutator transaction binding the contract method 0x1785f53c. // // Solidity: function removeAdmin(address admin) returns() -func (_Exchangefees *ExchangefeesTransactorSession) RemoveAdmin(admin common.Address) (*types.Transaction, error) { - return _Exchangefees.Contract.RemoveAdmin(&_Exchangefees.TransactOpts, admin) +func (_ExchangeFees *ExchangeFeesTransactorSession) RemoveAdmin(admin common.Address) (*types.Transaction, error) { + return _ExchangeFees.Contract.RemoveAdmin(&_ExchangeFees.TransactOpts, admin) } // RenounceAdmin is a paid mutator transaction binding the contract method 0x8bad0c0a. // // Solidity: function renounceAdmin() returns() -func (_Exchangefees *ExchangefeesTransactor) RenounceAdmin(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Exchangefees.contract.Transact(opts, "renounceAdmin") +func (_ExchangeFees *ExchangeFeesTransactor) RenounceAdmin(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ExchangeFees.contract.Transact(opts, "renounceAdmin") } // RenounceAdmin is a paid mutator transaction binding the contract method 0x8bad0c0a. // // Solidity: function renounceAdmin() returns() -func (_Exchangefees *ExchangefeesSession) RenounceAdmin() (*types.Transaction, error) { - return _Exchangefees.Contract.RenounceAdmin(&_Exchangefees.TransactOpts) +func (_ExchangeFees *ExchangeFeesSession) RenounceAdmin() (*types.Transaction, error) { + return _ExchangeFees.Contract.RenounceAdmin(&_ExchangeFees.TransactOpts) } // RenounceAdmin is a paid mutator transaction binding the contract method 0x8bad0c0a. // // Solidity: function renounceAdmin() returns() -func (_Exchangefees *ExchangefeesTransactorSession) RenounceAdmin() (*types.Transaction, error) { - return _Exchangefees.Contract.RenounceAdmin(&_Exchangefees.TransactOpts) +func (_ExchangeFees *ExchangeFeesTransactorSession) RenounceAdmin() (*types.Transaction, error) { + return _ExchangeFees.Contract.RenounceAdmin(&_ExchangeFees.TransactOpts) } // WithdrawFees is a paid mutator transaction binding the contract method 0x425c2096. // // Solidity: function withdrawFees(address to, uint256 id, uint256 amount) returns() -func (_Exchangefees *ExchangefeesTransactor) WithdrawFees(opts *bind.TransactOpts, to common.Address, id *big.Int, amount *big.Int) (*types.Transaction, error) { - return _Exchangefees.contract.Transact(opts, "withdrawFees", to, id, amount) +func (_ExchangeFees *ExchangeFeesTransactor) WithdrawFees(opts *bind.TransactOpts, to common.Address, id *big.Int, amount *big.Int) (*types.Transaction, error) { + return _ExchangeFees.contract.Transact(opts, "withdrawFees", to, id, amount) } // WithdrawFees is a paid mutator transaction binding the contract method 0x425c2096. // // Solidity: function withdrawFees(address to, uint256 id, uint256 amount) returns() -func (_Exchangefees *ExchangefeesSession) WithdrawFees(to common.Address, id *big.Int, amount *big.Int) (*types.Transaction, error) { - return _Exchangefees.Contract.WithdrawFees(&_Exchangefees.TransactOpts, to, id, amount) +func (_ExchangeFees *ExchangeFeesSession) WithdrawFees(to common.Address, id *big.Int, amount *big.Int) (*types.Transaction, error) { + return _ExchangeFees.Contract.WithdrawFees(&_ExchangeFees.TransactOpts, to, id, amount) } // WithdrawFees is a paid mutator transaction binding the contract method 0x425c2096. // // Solidity: function withdrawFees(address to, uint256 id, uint256 amount) returns() -func (_Exchangefees *ExchangefeesTransactorSession) WithdrawFees(to common.Address, id *big.Int, amount *big.Int) (*types.Transaction, error) { - return _Exchangefees.Contract.WithdrawFees(&_Exchangefees.TransactOpts, to, id, amount) +func (_ExchangeFees *ExchangeFeesTransactorSession) WithdrawFees(to common.Address, id *big.Int, amount *big.Int) (*types.Transaction, error) { + return _ExchangeFees.Contract.WithdrawFees(&_ExchangeFees.TransactOpts, to, id, amount) } -// ExchangefeesFeeRefundedIterator is returned from FilterFeeRefunded and is used to iterate over the raw logs and unpacked data for FeeRefunded events raised by the Exchangefees contract. -type ExchangefeesFeeRefundedIterator struct { - Event *ExchangefeesFeeRefunded // Event containing the contract specifics and raw log +// ExchangeFeesFeeRefundedIterator is returned from FilterFeeRefunded and is used to iterate over the raw logs and unpacked data for FeeRefunded events raised by the ExchangeFees contract. +type ExchangeFeesFeeRefundedIterator struct { + Event *ExchangeFeesFeeRefunded // 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 @@ -514,7 +515,7 @@ type ExchangefeesFeeRefundedIterator struct { // 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 *ExchangefeesFeeRefundedIterator) Next() bool { +func (it *ExchangeFeesFeeRefundedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -523,7 +524,7 @@ func (it *ExchangefeesFeeRefundedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ExchangefeesFeeRefunded) + it.Event = new(ExchangeFeesFeeRefunded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -538,7 +539,7 @@ func (it *ExchangefeesFeeRefundedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ExchangefeesFeeRefunded) + it.Event = new(ExchangeFeesFeeRefunded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -554,19 +555,19 @@ func (it *ExchangefeesFeeRefundedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ExchangefeesFeeRefundedIterator) Error() error { +func (it *ExchangeFeesFeeRefundedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ExchangefeesFeeRefundedIterator) Close() error { +func (it *ExchangeFeesFeeRefundedIterator) Close() error { it.sub.Unsubscribe() return nil } -// ExchangefeesFeeRefunded represents a FeeRefunded event raised by the Exchangefees contract. -type ExchangefeesFeeRefunded struct { +// ExchangeFeesFeeRefunded represents a FeeRefunded event raised by the ExchangeFees contract. +type ExchangeFeesFeeRefunded struct { Token common.Address To common.Address Id *big.Int @@ -577,21 +578,21 @@ type ExchangefeesFeeRefunded struct { // FilterFeeRefunded is a free log retrieval operation binding the contract event 0x18fe0464eb77016dc4e227eb0d690e4002756d82b442143bbfb874548952b5f2. // // Solidity: event FeeRefunded(address token, address to, uint256 id, uint256 amount) -func (_Exchangefees *ExchangefeesFilterer) FilterFeeRefunded(opts *bind.FilterOpts) (*ExchangefeesFeeRefundedIterator, error) { +func (_ExchangeFees *ExchangeFeesFilterer) FilterFeeRefunded(opts *bind.FilterOpts) (*ExchangeFeesFeeRefundedIterator, error) { - logs, sub, err := _Exchangefees.contract.FilterLogs(opts, "FeeRefunded") + logs, sub, err := _ExchangeFees.contract.FilterLogs(opts, "FeeRefunded") if err != nil { return nil, err } - return &ExchangefeesFeeRefundedIterator{contract: _Exchangefees.contract, event: "FeeRefunded", logs: logs, sub: sub}, nil + return &ExchangeFeesFeeRefundedIterator{contract: _ExchangeFees.contract, event: "FeeRefunded", logs: logs, sub: sub}, nil } // WatchFeeRefunded is a free log subscription operation binding the contract event 0x18fe0464eb77016dc4e227eb0d690e4002756d82b442143bbfb874548952b5f2. // // Solidity: event FeeRefunded(address token, address to, uint256 id, uint256 amount) -func (_Exchangefees *ExchangefeesFilterer) WatchFeeRefunded(opts *bind.WatchOpts, sink chan<- *ExchangefeesFeeRefunded) (event.Subscription, error) { +func (_ExchangeFees *ExchangeFeesFilterer) WatchFeeRefunded(opts *bind.WatchOpts, sink chan<- *ExchangeFeesFeeRefunded) (event.Subscription, error) { - logs, sub, err := _Exchangefees.contract.WatchLogs(opts, "FeeRefunded") + logs, sub, err := _ExchangeFees.contract.WatchLogs(opts, "FeeRefunded") if err != nil { return nil, err } @@ -601,8 +602,8 @@ func (_Exchangefees *ExchangefeesFilterer) WatchFeeRefunded(opts *bind.WatchOpts select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ExchangefeesFeeRefunded) - if err := _Exchangefees.contract.UnpackLog(event, "FeeRefunded", log); err != nil { + event := new(ExchangeFeesFeeRefunded) + if err := _ExchangeFees.contract.UnpackLog(event, "FeeRefunded", log); err != nil { return err } event.Raw = log @@ -626,18 +627,18 @@ func (_Exchangefees *ExchangefeesFilterer) WatchFeeRefunded(opts *bind.WatchOpts // ParseFeeRefunded is a log parse operation binding the contract event 0x18fe0464eb77016dc4e227eb0d690e4002756d82b442143bbfb874548952b5f2. // // Solidity: event FeeRefunded(address token, address to, uint256 id, uint256 amount) -func (_Exchangefees *ExchangefeesFilterer) ParseFeeRefunded(log types.Log) (*ExchangefeesFeeRefunded, error) { - event := new(ExchangefeesFeeRefunded) - if err := _Exchangefees.contract.UnpackLog(event, "FeeRefunded", log); err != nil { +func (_ExchangeFees *ExchangeFeesFilterer) ParseFeeRefunded(log types.Log) (*ExchangeFeesFeeRefunded, error) { + event := new(ExchangeFeesFeeRefunded) + if err := _ExchangeFees.contract.UnpackLog(event, "FeeRefunded", log); err != nil { return nil, err } event.Raw = log return event, nil } -// ExchangefeesFeeWithdrawnIterator is returned from FilterFeeWithdrawn and is used to iterate over the raw logs and unpacked data for FeeWithdrawn events raised by the Exchangefees contract. -type ExchangefeesFeeWithdrawnIterator struct { - Event *ExchangefeesFeeWithdrawn // Event containing the contract specifics and raw log +// ExchangeFeesFeeWithdrawnIterator is returned from FilterFeeWithdrawn and is used to iterate over the raw logs and unpacked data for FeeWithdrawn events raised by the ExchangeFees contract. +type ExchangeFeesFeeWithdrawnIterator struct { + Event *ExchangeFeesFeeWithdrawn // 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 @@ -651,7 +652,7 @@ type ExchangefeesFeeWithdrawnIterator struct { // 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 *ExchangefeesFeeWithdrawnIterator) Next() bool { +func (it *ExchangeFeesFeeWithdrawnIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -660,7 +661,7 @@ func (it *ExchangefeesFeeWithdrawnIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ExchangefeesFeeWithdrawn) + it.Event = new(ExchangeFeesFeeWithdrawn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -675,7 +676,7 @@ func (it *ExchangefeesFeeWithdrawnIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ExchangefeesFeeWithdrawn) + it.Event = new(ExchangeFeesFeeWithdrawn) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -691,19 +692,19 @@ func (it *ExchangefeesFeeWithdrawnIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ExchangefeesFeeWithdrawnIterator) Error() error { +func (it *ExchangeFeesFeeWithdrawnIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ExchangefeesFeeWithdrawnIterator) Close() error { +func (it *ExchangeFeesFeeWithdrawnIterator) Close() error { it.sub.Unsubscribe() return nil } -// ExchangefeesFeeWithdrawn represents a FeeWithdrawn event raised by the Exchangefees contract. -type ExchangefeesFeeWithdrawn struct { +// ExchangeFeesFeeWithdrawn represents a FeeWithdrawn event raised by the ExchangeFees contract. +type ExchangeFeesFeeWithdrawn struct { Token common.Address To common.Address Id *big.Int @@ -714,21 +715,21 @@ type ExchangefeesFeeWithdrawn struct { // FilterFeeWithdrawn is a free log retrieval operation binding the contract event 0x6ce49f8691a80db5eb4f60cd55b14640529346a7ddf9bf8f77a423fa6a10bfdb. // // Solidity: event FeeWithdrawn(address token, address to, uint256 id, uint256 amount) -func (_Exchangefees *ExchangefeesFilterer) FilterFeeWithdrawn(opts *bind.FilterOpts) (*ExchangefeesFeeWithdrawnIterator, error) { +func (_ExchangeFees *ExchangeFeesFilterer) FilterFeeWithdrawn(opts *bind.FilterOpts) (*ExchangeFeesFeeWithdrawnIterator, error) { - logs, sub, err := _Exchangefees.contract.FilterLogs(opts, "FeeWithdrawn") + logs, sub, err := _ExchangeFees.contract.FilterLogs(opts, "FeeWithdrawn") if err != nil { return nil, err } - return &ExchangefeesFeeWithdrawnIterator{contract: _Exchangefees.contract, event: "FeeWithdrawn", logs: logs, sub: sub}, nil + return &ExchangeFeesFeeWithdrawnIterator{contract: _ExchangeFees.contract, event: "FeeWithdrawn", logs: logs, sub: sub}, nil } // WatchFeeWithdrawn is a free log subscription operation binding the contract event 0x6ce49f8691a80db5eb4f60cd55b14640529346a7ddf9bf8f77a423fa6a10bfdb. // // Solidity: event FeeWithdrawn(address token, address to, uint256 id, uint256 amount) -func (_Exchangefees *ExchangefeesFilterer) WatchFeeWithdrawn(opts *bind.WatchOpts, sink chan<- *ExchangefeesFeeWithdrawn) (event.Subscription, error) { +func (_ExchangeFees *ExchangeFeesFilterer) WatchFeeWithdrawn(opts *bind.WatchOpts, sink chan<- *ExchangeFeesFeeWithdrawn) (event.Subscription, error) { - logs, sub, err := _Exchangefees.contract.WatchLogs(opts, "FeeWithdrawn") + logs, sub, err := _ExchangeFees.contract.WatchLogs(opts, "FeeWithdrawn") if err != nil { return nil, err } @@ -738,8 +739,8 @@ func (_Exchangefees *ExchangefeesFilterer) WatchFeeWithdrawn(opts *bind.WatchOpt select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ExchangefeesFeeWithdrawn) - if err := _Exchangefees.contract.UnpackLog(event, "FeeWithdrawn", log); err != nil { + event := new(ExchangeFeesFeeWithdrawn) + if err := _ExchangeFees.contract.UnpackLog(event, "FeeWithdrawn", log); err != nil { return err } event.Raw = log @@ -763,18 +764,18 @@ func (_Exchangefees *ExchangefeesFilterer) WatchFeeWithdrawn(opts *bind.WatchOpt // ParseFeeWithdrawn is a log parse operation binding the contract event 0x6ce49f8691a80db5eb4f60cd55b14640529346a7ddf9bf8f77a423fa6a10bfdb. // // Solidity: event FeeWithdrawn(address token, address to, uint256 id, uint256 amount) -func (_Exchangefees *ExchangefeesFilterer) ParseFeeWithdrawn(log types.Log) (*ExchangefeesFeeWithdrawn, error) { - event := new(ExchangefeesFeeWithdrawn) - if err := _Exchangefees.contract.UnpackLog(event, "FeeWithdrawn", log); err != nil { +func (_ExchangeFees *ExchangeFeesFilterer) ParseFeeWithdrawn(log types.Log) (*ExchangeFeesFeeWithdrawn, error) { + event := new(ExchangeFeesFeeWithdrawn) + if err := _ExchangeFees.contract.UnpackLog(event, "FeeWithdrawn", log); err != nil { return nil, err } event.Raw = log return event, nil } -// ExchangefeesNewAdminIterator is returned from FilterNewAdmin and is used to iterate over the raw logs and unpacked data for NewAdmin events raised by the Exchangefees contract. -type ExchangefeesNewAdminIterator struct { - Event *ExchangefeesNewAdmin // Event containing the contract specifics and raw log +// ExchangeFeesNewAdminIterator is returned from FilterNewAdmin and is used to iterate over the raw logs and unpacked data for NewAdmin events raised by the ExchangeFees contract. +type ExchangeFeesNewAdminIterator struct { + Event *ExchangeFeesNewAdmin // 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 @@ -788,7 +789,7 @@ type ExchangefeesNewAdminIterator struct { // 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 *ExchangefeesNewAdminIterator) Next() bool { +func (it *ExchangeFeesNewAdminIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -797,7 +798,7 @@ func (it *ExchangefeesNewAdminIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ExchangefeesNewAdmin) + it.Event = new(ExchangeFeesNewAdmin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -812,7 +813,7 @@ func (it *ExchangefeesNewAdminIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ExchangefeesNewAdmin) + it.Event = new(ExchangeFeesNewAdmin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -828,19 +829,19 @@ func (it *ExchangefeesNewAdminIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ExchangefeesNewAdminIterator) Error() error { +func (it *ExchangeFeesNewAdminIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ExchangefeesNewAdminIterator) Close() error { +func (it *ExchangeFeesNewAdminIterator) Close() error { it.sub.Unsubscribe() return nil } -// ExchangefeesNewAdmin represents a NewAdmin event raised by the Exchangefees contract. -type ExchangefeesNewAdmin struct { +// ExchangeFeesNewAdmin represents a NewAdmin event raised by the ExchangeFees contract. +type ExchangeFeesNewAdmin struct { Admin common.Address NewAdminAddress common.Address Raw types.Log // Blockchain specific contextual infos @@ -849,7 +850,7 @@ type ExchangefeesNewAdmin struct { // FilterNewAdmin is a free log retrieval operation binding the contract event 0xf9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc. // // Solidity: event NewAdmin(address indexed admin, address indexed newAdminAddress) -func (_Exchangefees *ExchangefeesFilterer) FilterNewAdmin(opts *bind.FilterOpts, admin []common.Address, newAdminAddress []common.Address) (*ExchangefeesNewAdminIterator, error) { +func (_ExchangeFees *ExchangeFeesFilterer) FilterNewAdmin(opts *bind.FilterOpts, admin []common.Address, newAdminAddress []common.Address) (*ExchangeFeesNewAdminIterator, error) { var adminRule []interface{} for _, adminItem := range admin { @@ -860,17 +861,17 @@ func (_Exchangefees *ExchangefeesFilterer) FilterNewAdmin(opts *bind.FilterOpts, newAdminAddressRule = append(newAdminAddressRule, newAdminAddressItem) } - logs, sub, err := _Exchangefees.contract.FilterLogs(opts, "NewAdmin", adminRule, newAdminAddressRule) + logs, sub, err := _ExchangeFees.contract.FilterLogs(opts, "NewAdmin", adminRule, newAdminAddressRule) if err != nil { return nil, err } - return &ExchangefeesNewAdminIterator{contract: _Exchangefees.contract, event: "NewAdmin", logs: logs, sub: sub}, nil + return &ExchangeFeesNewAdminIterator{contract: _ExchangeFees.contract, event: "NewAdmin", logs: logs, sub: sub}, nil } // WatchNewAdmin is a free log subscription operation binding the contract event 0xf9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc. // // Solidity: event NewAdmin(address indexed admin, address indexed newAdminAddress) -func (_Exchangefees *ExchangefeesFilterer) WatchNewAdmin(opts *bind.WatchOpts, sink chan<- *ExchangefeesNewAdmin, admin []common.Address, newAdminAddress []common.Address) (event.Subscription, error) { +func (_ExchangeFees *ExchangeFeesFilterer) WatchNewAdmin(opts *bind.WatchOpts, sink chan<- *ExchangeFeesNewAdmin, admin []common.Address, newAdminAddress []common.Address) (event.Subscription, error) { var adminRule []interface{} for _, adminItem := range admin { @@ -881,7 +882,7 @@ func (_Exchangefees *ExchangefeesFilterer) WatchNewAdmin(opts *bind.WatchOpts, s newAdminAddressRule = append(newAdminAddressRule, newAdminAddressItem) } - logs, sub, err := _Exchangefees.contract.WatchLogs(opts, "NewAdmin", adminRule, newAdminAddressRule) + logs, sub, err := _ExchangeFees.contract.WatchLogs(opts, "NewAdmin", adminRule, newAdminAddressRule) if err != nil { return nil, err } @@ -891,8 +892,8 @@ func (_Exchangefees *ExchangefeesFilterer) WatchNewAdmin(opts *bind.WatchOpts, s select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ExchangefeesNewAdmin) - if err := _Exchangefees.contract.UnpackLog(event, "NewAdmin", log); err != nil { + event := new(ExchangeFeesNewAdmin) + if err := _ExchangeFees.contract.UnpackLog(event, "NewAdmin", log); err != nil { return err } event.Raw = log @@ -916,18 +917,18 @@ func (_Exchangefees *ExchangefeesFilterer) WatchNewAdmin(opts *bind.WatchOpts, s // ParseNewAdmin is a log parse operation binding the contract event 0xf9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc. // // Solidity: event NewAdmin(address indexed admin, address indexed newAdminAddress) -func (_Exchangefees *ExchangefeesFilterer) ParseNewAdmin(log types.Log) (*ExchangefeesNewAdmin, error) { - event := new(ExchangefeesNewAdmin) - if err := _Exchangefees.contract.UnpackLog(event, "NewAdmin", log); err != nil { +func (_ExchangeFees *ExchangeFeesFilterer) ParseNewAdmin(log types.Log) (*ExchangeFeesNewAdmin, error) { + event := new(ExchangeFeesNewAdmin) + if err := _ExchangeFees.contract.UnpackLog(event, "NewAdmin", log); err != nil { return nil, err } event.Raw = log return event, nil } -// ExchangefeesRemovedAdminIterator is returned from FilterRemovedAdmin and is used to iterate over the raw logs and unpacked data for RemovedAdmin events raised by the Exchangefees contract. -type ExchangefeesRemovedAdminIterator struct { - Event *ExchangefeesRemovedAdmin // Event containing the contract specifics and raw log +// ExchangeFeesRemovedAdminIterator is returned from FilterRemovedAdmin and is used to iterate over the raw logs and unpacked data for RemovedAdmin events raised by the ExchangeFees contract. +type ExchangeFeesRemovedAdminIterator struct { + Event *ExchangeFeesRemovedAdmin // 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 @@ -941,7 +942,7 @@ type ExchangefeesRemovedAdminIterator struct { // 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 *ExchangefeesRemovedAdminIterator) Next() bool { +func (it *ExchangeFeesRemovedAdminIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -950,7 +951,7 @@ func (it *ExchangefeesRemovedAdminIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ExchangefeesRemovedAdmin) + it.Event = new(ExchangeFeesRemovedAdmin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -965,7 +966,7 @@ func (it *ExchangefeesRemovedAdminIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ExchangefeesRemovedAdmin) + it.Event = new(ExchangeFeesRemovedAdmin) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -981,19 +982,19 @@ func (it *ExchangefeesRemovedAdminIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ExchangefeesRemovedAdminIterator) Error() error { +func (it *ExchangeFeesRemovedAdminIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ExchangefeesRemovedAdminIterator) Close() error { +func (it *ExchangeFeesRemovedAdminIterator) Close() error { it.sub.Unsubscribe() return nil } -// ExchangefeesRemovedAdmin represents a RemovedAdmin event raised by the Exchangefees contract. -type ExchangefeesRemovedAdmin struct { +// ExchangeFeesRemovedAdmin represents a RemovedAdmin event raised by the ExchangeFees contract. +type ExchangeFeesRemovedAdmin struct { Admin common.Address RemovedAdmin common.Address Raw types.Log // Blockchain specific contextual infos @@ -1002,7 +1003,7 @@ type ExchangefeesRemovedAdmin struct { // FilterRemovedAdmin is a free log retrieval operation binding the contract event 0x787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e. // // Solidity: event RemovedAdmin(address indexed admin, address indexed removedAdmin) -func (_Exchangefees *ExchangefeesFilterer) FilterRemovedAdmin(opts *bind.FilterOpts, admin []common.Address, removedAdmin []common.Address) (*ExchangefeesRemovedAdminIterator, error) { +func (_ExchangeFees *ExchangeFeesFilterer) FilterRemovedAdmin(opts *bind.FilterOpts, admin []common.Address, removedAdmin []common.Address) (*ExchangeFeesRemovedAdminIterator, error) { var adminRule []interface{} for _, adminItem := range admin { @@ -1013,17 +1014,17 @@ func (_Exchangefees *ExchangefeesFilterer) FilterRemovedAdmin(opts *bind.FilterO removedAdminRule = append(removedAdminRule, removedAdminItem) } - logs, sub, err := _Exchangefees.contract.FilterLogs(opts, "RemovedAdmin", adminRule, removedAdminRule) + logs, sub, err := _ExchangeFees.contract.FilterLogs(opts, "RemovedAdmin", adminRule, removedAdminRule) if err != nil { return nil, err } - return &ExchangefeesRemovedAdminIterator{contract: _Exchangefees.contract, event: "RemovedAdmin", logs: logs, sub: sub}, nil + return &ExchangeFeesRemovedAdminIterator{contract: _ExchangeFees.contract, event: "RemovedAdmin", logs: logs, sub: sub}, nil } // WatchRemovedAdmin is a free log subscription operation binding the contract event 0x787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e. // // Solidity: event RemovedAdmin(address indexed admin, address indexed removedAdmin) -func (_Exchangefees *ExchangefeesFilterer) WatchRemovedAdmin(opts *bind.WatchOpts, sink chan<- *ExchangefeesRemovedAdmin, admin []common.Address, removedAdmin []common.Address) (event.Subscription, error) { +func (_ExchangeFees *ExchangeFeesFilterer) WatchRemovedAdmin(opts *bind.WatchOpts, sink chan<- *ExchangeFeesRemovedAdmin, admin []common.Address, removedAdmin []common.Address) (event.Subscription, error) { var adminRule []interface{} for _, adminItem := range admin { @@ -1034,7 +1035,7 @@ func (_Exchangefees *ExchangefeesFilterer) WatchRemovedAdmin(opts *bind.WatchOpt removedAdminRule = append(removedAdminRule, removedAdminItem) } - logs, sub, err := _Exchangefees.contract.WatchLogs(opts, "RemovedAdmin", adminRule, removedAdminRule) + logs, sub, err := _ExchangeFees.contract.WatchLogs(opts, "RemovedAdmin", adminRule, removedAdminRule) if err != nil { return nil, err } @@ -1044,8 +1045,8 @@ func (_Exchangefees *ExchangefeesFilterer) WatchRemovedAdmin(opts *bind.WatchOpt select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ExchangefeesRemovedAdmin) - if err := _Exchangefees.contract.UnpackLog(event, "RemovedAdmin", log); err != nil { + event := new(ExchangeFeesRemovedAdmin) + if err := _ExchangeFees.contract.UnpackLog(event, "RemovedAdmin", log); err != nil { return err } event.Raw = log @@ -1069,9 +1070,9 @@ func (_Exchangefees *ExchangefeesFilterer) WatchRemovedAdmin(opts *bind.WatchOpt // ParseRemovedAdmin is a log parse operation binding the contract event 0x787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e. // // Solidity: event RemovedAdmin(address indexed admin, address indexed removedAdmin) -func (_Exchangefees *ExchangefeesFilterer) ParseRemovedAdmin(log types.Log) (*ExchangefeesRemovedAdmin, error) { - event := new(ExchangefeesRemovedAdmin) - if err := _Exchangefees.contract.UnpackLog(event, "RemovedAdmin", log); err != nil { +func (_ExchangeFees *ExchangeFeesFilterer) ParseRemovedAdmin(log types.Log) (*ExchangeFeesRemovedAdmin, error) { + event := new(ExchangeFeesRemovedAdmin) + if err := _ExchangeFees.contract.UnpackLog(event, "RemovedAdmin", log); err != nil { return nil, err } event.Raw = log diff --git a/pkg/contracts/exchange/exchange.go b/pkg/contracts/exchange/exchange.go index e9f8064..5a63dfa 100644 --- a/pkg/contracts/exchange/exchange.go +++ b/pkg/contracts/exchange/exchange.go @@ -26,6 +26,7 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // Order is an auto generated low-level Go binding around an user-defined struct. @@ -53,7 +54,7 @@ type OrderStatus struct { // ExchangeMetaData contains all meta data concerning the Exchange contract. var ExchangeMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_collateral\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ctf\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proxyFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_safeFactory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidComplement\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MakingGtRemaining\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MismatchedTokenIds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotCrossing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotOperator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotTaker\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderFilledOrCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Paused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooLittleTokensReceived\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeeCharged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdminAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"NewAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOperatorAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"NewOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"}],\"name\":\"OrderCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"filled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"OrderFilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"takerOrderHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"takerOrderMaker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAmountFilled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAmountFilled\",\"type\":\"uint256\"}],\"name\":\"OrdersMatched\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldProxyFactory\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newProxyFactory\",\"type\":\"address\"}],\"name\":\"ProxyFactoryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"RemovedAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"RemovedOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldSafeFactory\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newSafeFactory\",\"type\":\"address\"}],\"name\":\"SafeFactoryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"token0\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"token1\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"conditionId\",\"type\":\"bytes32\"}],\"name\":\"TokenRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pauser\",\"type\":\"address\"}],\"name\":\"TradingPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pauser\",\"type\":\"address\"}],\"name\":\"TradingUnpaused\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"name\":\"addAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator_\",\"type\":\"address\"}],\"name\":\"addOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"admins\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"cancelOrder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"orders\",\"type\":\"tuple[]\"}],\"name\":\"cancelOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"domainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"fillAmount\",\"type\":\"uint256\"}],\"name\":\"fillOrder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"orders\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"fillAmounts\",\"type\":\"uint256[]\"}],\"name\":\"fillOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCollateral\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"}],\"name\":\"getComplement\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"}],\"name\":\"getConditionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCtf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxFeeRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"}],\"name\":\"getOrderStatus\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isFilledOrCancelled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"internalType\":\"structOrderStatus\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPolyProxyFactoryImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getPolyProxyWalletAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProxyFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getSafeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSafeFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSafeFactoryImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"hashOrder\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"incrementNonce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"}],\"name\":\"isOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"isValidNonce\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"takerOrder\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"makerOrders\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"takerFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"makerFillAmounts\",\"type\":\"uint256[]\"}],\"name\":\"matchOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"operators\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"orderStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isFilledOrCancelled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentCollectionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauseTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxyFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complement\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"conditionId\",\"type\":\"bytes32\"}],\"name\":\"registerToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"registry\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"complement\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"conditionId\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"removeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"removeOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdminRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOperatorRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safeFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newProxyFactory\",\"type\":\"address\"}],\"name\":\"setProxyFactory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newSafeFactory\",\"type\":\"address\"}],\"name\":\"setSafeFactory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpauseTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complement\",\"type\":\"uint256\"}],\"name\":\"validateComplement\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"validateOrder\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"validateOrderSignature\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"validateTokenId\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_collateral\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ctf\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proxyFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_safeFactory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidComplement\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MakingGtRemaining\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MismatchedTokenIds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotCrossing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotOperator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotTaker\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderFilledOrCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Paused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooLittleTokensReceived\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeeCharged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdminAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"NewAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOperatorAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"NewOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"}],\"name\":\"OrderCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAmountFilled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAmountFilled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"OrderFilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"takerOrderHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"takerOrderMaker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAmountFilled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAmountFilled\",\"type\":\"uint256\"}],\"name\":\"OrdersMatched\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldProxyFactory\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newProxyFactory\",\"type\":\"address\"}],\"name\":\"ProxyFactoryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"RemovedAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"RemovedOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldSafeFactory\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newSafeFactory\",\"type\":\"address\"}],\"name\":\"SafeFactoryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"token0\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"token1\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"conditionId\",\"type\":\"bytes32\"}],\"name\":\"TokenRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pauser\",\"type\":\"address\"}],\"name\":\"TradingPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pauser\",\"type\":\"address\"}],\"name\":\"TradingUnpaused\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"name\":\"addAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator_\",\"type\":\"address\"}],\"name\":\"addOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"admins\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"cancelOrder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"orders\",\"type\":\"tuple[]\"}],\"name\":\"cancelOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"domainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"fillAmount\",\"type\":\"uint256\"}],\"name\":\"fillOrder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"orders\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"fillAmounts\",\"type\":\"uint256[]\"}],\"name\":\"fillOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCollateral\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"}],\"name\":\"getComplement\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"}],\"name\":\"getConditionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCtf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxFeeRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"}],\"name\":\"getOrderStatus\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isFilledOrCancelled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"internalType\":\"structOrderStatus\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPolyProxyFactoryImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getPolyProxyWalletAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProxyFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getSafeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSafeFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSafeFactoryImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"hashOrder\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"incrementNonce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"}],\"name\":\"isOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"isValidNonce\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"takerOrder\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"makerOrders\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"takerFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"makerFillAmounts\",\"type\":\"uint256[]\"}],\"name\":\"matchOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"operators\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"orderStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isFilledOrCancelled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentCollectionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauseTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxyFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complement\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"conditionId\",\"type\":\"bytes32\"}],\"name\":\"registerToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"registry\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"complement\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"conditionId\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"removeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"removeOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdminRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOperatorRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safeFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newProxyFactory\",\"type\":\"address\"}],\"name\":\"setProxyFactory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newSafeFactory\",\"type\":\"address\"}],\"name\":\"setSafeFactory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpauseTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complement\",\"type\":\"uint256\"}],\"name\":\"validateComplement\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"validateOrder\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"validateOrderSignature\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"validateTokenId\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // ExchangeABI is the input ABI used to generate the binding from. @@ -157,11 +158,11 @@ func NewExchangeFilterer(address common.Address, filterer bind.ContractFilterer) // bindExchange binds a generic wrapper to an already deployed contract. func bindExchange(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(ExchangeABI)) + parsed, err := ExchangeMetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and @@ -2247,20 +2248,20 @@ func (it *ExchangeOrderFilledIterator) Close() error { // ExchangeOrderFilled represents a OrderFilled event raised by the Exchange contract. type ExchangeOrderFilled struct { - OrderHash [32]byte - Maker common.Address - Taker common.Address - MakerAssetId *big.Int - TakerAssetId *big.Int - Filled *big.Int - Remaining *big.Int - Fee *big.Int - Raw types.Log // Blockchain specific contextual infos + OrderHash [32]byte + Maker common.Address + Taker common.Address + MakerAssetId *big.Int + TakerAssetId *big.Int + MakerAmountFilled *big.Int + TakerAmountFilled *big.Int + Fee *big.Int + Raw types.Log // Blockchain specific contextual infos } // FilterOrderFilled is a free log retrieval operation binding the contract event 0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6. // -// Solidity: event OrderFilled(bytes32 indexed orderHash, address indexed maker, address indexed taker, uint256 makerAssetId, uint256 takerAssetId, uint256 filled, uint256 remaining, uint256 fee) +// Solidity: event OrderFilled(bytes32 indexed orderHash, address indexed maker, address indexed taker, uint256 makerAssetId, uint256 takerAssetId, uint256 makerAmountFilled, uint256 takerAmountFilled, uint256 fee) func (_Exchange *ExchangeFilterer) FilterOrderFilled(opts *bind.FilterOpts, orderHash [][32]byte, maker []common.Address, taker []common.Address) (*ExchangeOrderFilledIterator, error) { var orderHashRule []interface{} @@ -2285,7 +2286,7 @@ func (_Exchange *ExchangeFilterer) FilterOrderFilled(opts *bind.FilterOpts, orde // WatchOrderFilled is a free log subscription operation binding the contract event 0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6. // -// Solidity: event OrderFilled(bytes32 indexed orderHash, address indexed maker, address indexed taker, uint256 makerAssetId, uint256 takerAssetId, uint256 filled, uint256 remaining, uint256 fee) +// Solidity: event OrderFilled(bytes32 indexed orderHash, address indexed maker, address indexed taker, uint256 makerAssetId, uint256 takerAssetId, uint256 makerAmountFilled, uint256 takerAmountFilled, uint256 fee) func (_Exchange *ExchangeFilterer) WatchOrderFilled(opts *bind.WatchOpts, sink chan<- *ExchangeOrderFilled, orderHash [][32]byte, maker []common.Address, taker []common.Address) (event.Subscription, error) { var orderHashRule []interface{} @@ -2335,7 +2336,7 @@ func (_Exchange *ExchangeFilterer) WatchOrderFilled(opts *bind.WatchOpts, sink c // ParseOrderFilled is a log parse operation binding the contract event 0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6. // -// Solidity: event OrderFilled(bytes32 indexed orderHash, address indexed maker, address indexed taker, uint256 makerAssetId, uint256 takerAssetId, uint256 filled, uint256 remaining, uint256 fee) +// Solidity: event OrderFilled(bytes32 indexed orderHash, address indexed maker, address indexed taker, uint256 makerAssetId, uint256 takerAssetId, uint256 makerAmountFilled, uint256 takerAmountFilled, uint256 fee) func (_Exchange *ExchangeFilterer) ParseOrderFilled(log types.Log) (*ExchangeOrderFilled, error) { event := new(ExchangeOrderFilled) if err := _Exchange.contract.UnpackLog(event, "OrderFilled", log); err != nil { diff --git a/pkg/contracts/neg-risk-fees/neg_risk_exchange_fees.go b/pkg/contracts/neg-risk-fees/neg_risk_exchange_fees.go new file mode 100644 index 0000000..d01b387 --- /dev/null +++ b/pkg/contracts/neg-risk-fees/neg_risk_exchange_fees.go @@ -0,0 +1,1080 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package neg_risk_fees + +import ( + "errors" + "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 ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// Order is an auto generated low-level Go binding around an user-defined struct. +type Order struct { + Salt *big.Int + Maker common.Address + Signer common.Address + Taker common.Address + TokenId *big.Int + MakerAmount *big.Int + TakerAmount *big.Int + Expiration *big.Int + Nonce *big.Int + FeeRateBps *big.Int + Side uint8 + SignatureType uint8 + Signature []byte +} + +// NegRiskFeesMetaData contains all meta data concerning the NegRiskFees contract. +var NegRiskFeesMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_negRiskCtfExchange\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_negRiskAdapter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ctf\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"NotAdmin\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeeRefunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeeWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdminAddress\",\"type\":\"address\"}],\"name\":\"NewAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedAdmin\",\"type\":\"address\"}],\"name\":\"RemovedAdmin\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"addAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"admins\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"collateral\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ctf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"exchange\",\"outputs\":[{\"internalType\":\"contractIExchange\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"takerOrder\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"makerOrders\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"takerFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"makerFillAmounts\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"makerFeeRate\",\"type\":\"uint256\"}],\"name\":\"matchOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"removeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// NegRiskFeesABI is the input ABI used to generate the binding from. +// Deprecated: Use NegRiskFeesMetaData.ABI instead. +var NegRiskFeesABI = NegRiskFeesMetaData.ABI + +// NegRiskFees is an auto generated Go binding around an Ethereum contract. +type NegRiskFees struct { + NegRiskFeesCaller // Read-only binding to the contract + NegRiskFeesTransactor // Write-only binding to the contract + NegRiskFeesFilterer // Log filterer for contract events +} + +// NegRiskFeesCaller is an auto generated read-only Go binding around an Ethereum contract. +type NegRiskFeesCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NegRiskFeesTransactor is an auto generated write-only Go binding around an Ethereum contract. +type NegRiskFeesTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NegRiskFeesFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type NegRiskFeesFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NegRiskFeesSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type NegRiskFeesSession struct { + Contract *NegRiskFees // 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 +} + +// NegRiskFeesCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type NegRiskFeesCallerSession struct { + Contract *NegRiskFeesCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// NegRiskFeesTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type NegRiskFeesTransactorSession struct { + Contract *NegRiskFeesTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// NegRiskFeesRaw is an auto generated low-level Go binding around an Ethereum contract. +type NegRiskFeesRaw struct { + Contract *NegRiskFees // Generic contract binding to access the raw methods on +} + +// NegRiskFeesCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type NegRiskFeesCallerRaw struct { + Contract *NegRiskFeesCaller // Generic read-only contract binding to access the raw methods on +} + +// NegRiskFeesTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type NegRiskFeesTransactorRaw struct { + Contract *NegRiskFeesTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewNegRiskFees creates a new instance of NegRiskFees, bound to a specific deployed contract. +func NewNegRiskFees(address common.Address, backend bind.ContractBackend) (*NegRiskFees, error) { + contract, err := bindNegRiskFees(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NegRiskFees{NegRiskFeesCaller: NegRiskFeesCaller{contract: contract}, NegRiskFeesTransactor: NegRiskFeesTransactor{contract: contract}, NegRiskFeesFilterer: NegRiskFeesFilterer{contract: contract}}, nil +} + +// NewNegRiskFeesCaller creates a new read-only instance of NegRiskFees, bound to a specific deployed contract. +func NewNegRiskFeesCaller(address common.Address, caller bind.ContractCaller) (*NegRiskFeesCaller, error) { + contract, err := bindNegRiskFees(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NegRiskFeesCaller{contract: contract}, nil +} + +// NewNegRiskFeesTransactor creates a new write-only instance of NegRiskFees, bound to a specific deployed contract. +func NewNegRiskFeesTransactor(address common.Address, transactor bind.ContractTransactor) (*NegRiskFeesTransactor, error) { + contract, err := bindNegRiskFees(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NegRiskFeesTransactor{contract: contract}, nil +} + +// NewNegRiskFeesFilterer creates a new log filterer instance of NegRiskFees, bound to a specific deployed contract. +func NewNegRiskFeesFilterer(address common.Address, filterer bind.ContractFilterer) (*NegRiskFeesFilterer, error) { + contract, err := bindNegRiskFees(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NegRiskFeesFilterer{contract: contract}, nil +} + +// bindNegRiskFees binds a generic wrapper to an already deployed contract. +func bindNegRiskFees(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := NegRiskFeesMetaData.GetAbi() + 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 (_NegRiskFees *NegRiskFeesRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NegRiskFees.Contract.NegRiskFeesCaller.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 (_NegRiskFees *NegRiskFeesRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRiskFees.Contract.NegRiskFeesTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NegRiskFees *NegRiskFeesRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NegRiskFees.Contract.NegRiskFeesTransactor.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 (_NegRiskFees *NegRiskFeesCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NegRiskFees.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 (_NegRiskFees *NegRiskFeesTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRiskFees.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NegRiskFees *NegRiskFeesTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NegRiskFees.Contract.contract.Transact(opts, method, params...) +} + +// Admins is a free data retrieval call binding the contract method 0x429b62e5. +// +// Solidity: function admins(address ) view returns(uint256) +func (_NegRiskFees *NegRiskFeesCaller) Admins(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _NegRiskFees.contract.Call(opts, &out, "admins", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Admins is a free data retrieval call binding the contract method 0x429b62e5. +// +// Solidity: function admins(address ) view returns(uint256) +func (_NegRiskFees *NegRiskFeesSession) Admins(arg0 common.Address) (*big.Int, error) { + return _NegRiskFees.Contract.Admins(&_NegRiskFees.CallOpts, arg0) +} + +// Admins is a free data retrieval call binding the contract method 0x429b62e5. +// +// Solidity: function admins(address ) view returns(uint256) +func (_NegRiskFees *NegRiskFeesCallerSession) Admins(arg0 common.Address) (*big.Int, error) { + return _NegRiskFees.Contract.Admins(&_NegRiskFees.CallOpts, arg0) +} + +// Collateral is a free data retrieval call binding the contract method 0xd8dfeb45. +// +// Solidity: function collateral() view returns(address) +func (_NegRiskFees *NegRiskFeesCaller) Collateral(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRiskFees.contract.Call(opts, &out, "collateral") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Collateral is a free data retrieval call binding the contract method 0xd8dfeb45. +// +// Solidity: function collateral() view returns(address) +func (_NegRiskFees *NegRiskFeesSession) Collateral() (common.Address, error) { + return _NegRiskFees.Contract.Collateral(&_NegRiskFees.CallOpts) +} + +// Collateral is a free data retrieval call binding the contract method 0xd8dfeb45. +// +// Solidity: function collateral() view returns(address) +func (_NegRiskFees *NegRiskFeesCallerSession) Collateral() (common.Address, error) { + return _NegRiskFees.Contract.Collateral(&_NegRiskFees.CallOpts) +} + +// Ctf is a free data retrieval call binding the contract method 0x22a9339f. +// +// Solidity: function ctf() view returns(address) +func (_NegRiskFees *NegRiskFeesCaller) Ctf(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRiskFees.contract.Call(opts, &out, "ctf") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Ctf is a free data retrieval call binding the contract method 0x22a9339f. +// +// Solidity: function ctf() view returns(address) +func (_NegRiskFees *NegRiskFeesSession) Ctf() (common.Address, error) { + return _NegRiskFees.Contract.Ctf(&_NegRiskFees.CallOpts) +} + +// Ctf is a free data retrieval call binding the contract method 0x22a9339f. +// +// Solidity: function ctf() view returns(address) +func (_NegRiskFees *NegRiskFeesCallerSession) Ctf() (common.Address, error) { + return _NegRiskFees.Contract.Ctf(&_NegRiskFees.CallOpts) +} + +// Exchange is a free data retrieval call binding the contract method 0xd2f7265a. +// +// Solidity: function exchange() view returns(address) +func (_NegRiskFees *NegRiskFeesCaller) Exchange(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRiskFees.contract.Call(opts, &out, "exchange") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Exchange is a free data retrieval call binding the contract method 0xd2f7265a. +// +// Solidity: function exchange() view returns(address) +func (_NegRiskFees *NegRiskFeesSession) Exchange() (common.Address, error) { + return _NegRiskFees.Contract.Exchange(&_NegRiskFees.CallOpts) +} + +// Exchange is a free data retrieval call binding the contract method 0xd2f7265a. +// +// Solidity: function exchange() view returns(address) +func (_NegRiskFees *NegRiskFeesCallerSession) Exchange() (common.Address, error) { + return _NegRiskFees.Contract.Exchange(&_NegRiskFees.CallOpts) +} + +// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. +// +// Solidity: function isAdmin(address addr) view returns(bool) +func (_NegRiskFees *NegRiskFeesCaller) IsAdmin(opts *bind.CallOpts, addr common.Address) (bool, error) { + var out []interface{} + err := _NegRiskFees.contract.Call(opts, &out, "isAdmin", addr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. +// +// Solidity: function isAdmin(address addr) view returns(bool) +func (_NegRiskFees *NegRiskFeesSession) IsAdmin(addr common.Address) (bool, error) { + return _NegRiskFees.Contract.IsAdmin(&_NegRiskFees.CallOpts, addr) +} + +// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. +// +// Solidity: function isAdmin(address addr) view returns(bool) +func (_NegRiskFees *NegRiskFeesCallerSession) IsAdmin(addr common.Address) (bool, error) { + return _NegRiskFees.Contract.IsAdmin(&_NegRiskFees.CallOpts, addr) +} + +// AddAdmin is a paid mutator transaction binding the contract method 0x70480275. +// +// Solidity: function addAdmin(address admin) returns() +func (_NegRiskFees *NegRiskFeesTransactor) AddAdmin(opts *bind.TransactOpts, admin common.Address) (*types.Transaction, error) { + return _NegRiskFees.contract.Transact(opts, "addAdmin", admin) +} + +// AddAdmin is a paid mutator transaction binding the contract method 0x70480275. +// +// Solidity: function addAdmin(address admin) returns() +func (_NegRiskFees *NegRiskFeesSession) AddAdmin(admin common.Address) (*types.Transaction, error) { + return _NegRiskFees.Contract.AddAdmin(&_NegRiskFees.TransactOpts, admin) +} + +// AddAdmin is a paid mutator transaction binding the contract method 0x70480275. +// +// Solidity: function addAdmin(address admin) returns() +func (_NegRiskFees *NegRiskFeesTransactorSession) AddAdmin(admin common.Address) (*types.Transaction, error) { + return _NegRiskFees.Contract.AddAdmin(&_NegRiskFees.TransactOpts, admin) +} + +// MatchOrders is a paid mutator transaction binding the contract method 0xd2539b37. +// +// Solidity: function matchOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) takerOrder, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts, uint256 makerFeeRate) returns() +func (_NegRiskFees *NegRiskFeesTransactor) MatchOrders(opts *bind.TransactOpts, takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int, makerFeeRate *big.Int) (*types.Transaction, error) { + return _NegRiskFees.contract.Transact(opts, "matchOrders", takerOrder, makerOrders, takerFillAmount, makerFillAmounts, makerFeeRate) +} + +// MatchOrders is a paid mutator transaction binding the contract method 0xd2539b37. +// +// Solidity: function matchOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) takerOrder, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts, uint256 makerFeeRate) returns() +func (_NegRiskFees *NegRiskFeesSession) MatchOrders(takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int, makerFeeRate *big.Int) (*types.Transaction, error) { + return _NegRiskFees.Contract.MatchOrders(&_NegRiskFees.TransactOpts, takerOrder, makerOrders, takerFillAmount, makerFillAmounts, makerFeeRate) +} + +// MatchOrders is a paid mutator transaction binding the contract method 0xd2539b37. +// +// Solidity: function matchOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) takerOrder, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts, uint256 makerFeeRate) returns() +func (_NegRiskFees *NegRiskFeesTransactorSession) MatchOrders(takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int, makerFeeRate *big.Int) (*types.Transaction, error) { + return _NegRiskFees.Contract.MatchOrders(&_NegRiskFees.TransactOpts, takerOrder, makerOrders, takerFillAmount, makerFillAmounts, makerFeeRate) +} + +// OnERC1155BatchReceived is a paid mutator transaction binding the contract method 0xbc197c81. +// +// Solidity: function onERC1155BatchReceived(address , address , uint256[] , uint256[] , bytes ) returns(bytes4) +func (_NegRiskFees *NegRiskFeesTransactor) OnERC1155BatchReceived(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRiskFees.contract.Transact(opts, "onERC1155BatchReceived", arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155BatchReceived is a paid mutator transaction binding the contract method 0xbc197c81. +// +// Solidity: function onERC1155BatchReceived(address , address , uint256[] , uint256[] , bytes ) returns(bytes4) +func (_NegRiskFees *NegRiskFeesSession) OnERC1155BatchReceived(arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRiskFees.Contract.OnERC1155BatchReceived(&_NegRiskFees.TransactOpts, arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155BatchReceived is a paid mutator transaction binding the contract method 0xbc197c81. +// +// Solidity: function onERC1155BatchReceived(address , address , uint256[] , uint256[] , bytes ) returns(bytes4) +func (_NegRiskFees *NegRiskFeesTransactorSession) OnERC1155BatchReceived(arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRiskFees.Contract.OnERC1155BatchReceived(&_NegRiskFees.TransactOpts, arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155Received is a paid mutator transaction binding the contract method 0xf23a6e61. +// +// Solidity: function onERC1155Received(address , address , uint256 , uint256 , bytes ) returns(bytes4) +func (_NegRiskFees *NegRiskFeesTransactor) OnERC1155Received(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRiskFees.contract.Transact(opts, "onERC1155Received", arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155Received is a paid mutator transaction binding the contract method 0xf23a6e61. +// +// Solidity: function onERC1155Received(address , address , uint256 , uint256 , bytes ) returns(bytes4) +func (_NegRiskFees *NegRiskFeesSession) OnERC1155Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRiskFees.Contract.OnERC1155Received(&_NegRiskFees.TransactOpts, arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155Received is a paid mutator transaction binding the contract method 0xf23a6e61. +// +// Solidity: function onERC1155Received(address , address , uint256 , uint256 , bytes ) returns(bytes4) +func (_NegRiskFees *NegRiskFeesTransactorSession) OnERC1155Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRiskFees.Contract.OnERC1155Received(&_NegRiskFees.TransactOpts, arg0, arg1, arg2, arg3, arg4) +} + +// RemoveAdmin is a paid mutator transaction binding the contract method 0x1785f53c. +// +// Solidity: function removeAdmin(address admin) returns() +func (_NegRiskFees *NegRiskFeesTransactor) RemoveAdmin(opts *bind.TransactOpts, admin common.Address) (*types.Transaction, error) { + return _NegRiskFees.contract.Transact(opts, "removeAdmin", admin) +} + +// RemoveAdmin is a paid mutator transaction binding the contract method 0x1785f53c. +// +// Solidity: function removeAdmin(address admin) returns() +func (_NegRiskFees *NegRiskFeesSession) RemoveAdmin(admin common.Address) (*types.Transaction, error) { + return _NegRiskFees.Contract.RemoveAdmin(&_NegRiskFees.TransactOpts, admin) +} + +// RemoveAdmin is a paid mutator transaction binding the contract method 0x1785f53c. +// +// Solidity: function removeAdmin(address admin) returns() +func (_NegRiskFees *NegRiskFeesTransactorSession) RemoveAdmin(admin common.Address) (*types.Transaction, error) { + return _NegRiskFees.Contract.RemoveAdmin(&_NegRiskFees.TransactOpts, admin) +} + +// RenounceAdmin is a paid mutator transaction binding the contract method 0x8bad0c0a. +// +// Solidity: function renounceAdmin() returns() +func (_NegRiskFees *NegRiskFeesTransactor) RenounceAdmin(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRiskFees.contract.Transact(opts, "renounceAdmin") +} + +// RenounceAdmin is a paid mutator transaction binding the contract method 0x8bad0c0a. +// +// Solidity: function renounceAdmin() returns() +func (_NegRiskFees *NegRiskFeesSession) RenounceAdmin() (*types.Transaction, error) { + return _NegRiskFees.Contract.RenounceAdmin(&_NegRiskFees.TransactOpts) +} + +// RenounceAdmin is a paid mutator transaction binding the contract method 0x8bad0c0a. +// +// Solidity: function renounceAdmin() returns() +func (_NegRiskFees *NegRiskFeesTransactorSession) RenounceAdmin() (*types.Transaction, error) { + return _NegRiskFees.Contract.RenounceAdmin(&_NegRiskFees.TransactOpts) +} + +// WithdrawFees is a paid mutator transaction binding the contract method 0x425c2096. +// +// Solidity: function withdrawFees(address to, uint256 id, uint256 amount) returns() +func (_NegRiskFees *NegRiskFeesTransactor) WithdrawFees(opts *bind.TransactOpts, to common.Address, id *big.Int, amount *big.Int) (*types.Transaction, error) { + return _NegRiskFees.contract.Transact(opts, "withdrawFees", to, id, amount) +} + +// WithdrawFees is a paid mutator transaction binding the contract method 0x425c2096. +// +// Solidity: function withdrawFees(address to, uint256 id, uint256 amount) returns() +func (_NegRiskFees *NegRiskFeesSession) WithdrawFees(to common.Address, id *big.Int, amount *big.Int) (*types.Transaction, error) { + return _NegRiskFees.Contract.WithdrawFees(&_NegRiskFees.TransactOpts, to, id, amount) +} + +// WithdrawFees is a paid mutator transaction binding the contract method 0x425c2096. +// +// Solidity: function withdrawFees(address to, uint256 id, uint256 amount) returns() +func (_NegRiskFees *NegRiskFeesTransactorSession) WithdrawFees(to common.Address, id *big.Int, amount *big.Int) (*types.Transaction, error) { + return _NegRiskFees.Contract.WithdrawFees(&_NegRiskFees.TransactOpts, to, id, amount) +} + +// NegRiskFeesFeeRefundedIterator is returned from FilterFeeRefunded and is used to iterate over the raw logs and unpacked data for FeeRefunded events raised by the NegRiskFees contract. +type NegRiskFeesFeeRefundedIterator struct { + Event *NegRiskFeesFeeRefunded // 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 *NegRiskFeesFeeRefundedIterator) 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(NegRiskFeesFeeRefunded) + 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(NegRiskFeesFeeRefunded) + 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 *NegRiskFeesFeeRefundedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskFeesFeeRefundedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskFeesFeeRefunded represents a FeeRefunded event raised by the NegRiskFees contract. +type NegRiskFeesFeeRefunded struct { + Token common.Address + To common.Address + Id *big.Int + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeeRefunded is a free log retrieval operation binding the contract event 0x18fe0464eb77016dc4e227eb0d690e4002756d82b442143bbfb874548952b5f2. +// +// Solidity: event FeeRefunded(address token, address to, uint256 id, uint256 amount) +func (_NegRiskFees *NegRiskFeesFilterer) FilterFeeRefunded(opts *bind.FilterOpts) (*NegRiskFeesFeeRefundedIterator, error) { + + logs, sub, err := _NegRiskFees.contract.FilterLogs(opts, "FeeRefunded") + if err != nil { + return nil, err + } + return &NegRiskFeesFeeRefundedIterator{contract: _NegRiskFees.contract, event: "FeeRefunded", logs: logs, sub: sub}, nil +} + +// WatchFeeRefunded is a free log subscription operation binding the contract event 0x18fe0464eb77016dc4e227eb0d690e4002756d82b442143bbfb874548952b5f2. +// +// Solidity: event FeeRefunded(address token, address to, uint256 id, uint256 amount) +func (_NegRiskFees *NegRiskFeesFilterer) WatchFeeRefunded(opts *bind.WatchOpts, sink chan<- *NegRiskFeesFeeRefunded) (event.Subscription, error) { + + logs, sub, err := _NegRiskFees.contract.WatchLogs(opts, "FeeRefunded") + 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(NegRiskFeesFeeRefunded) + if err := _NegRiskFees.contract.UnpackLog(event, "FeeRefunded", 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 +} + +// ParseFeeRefunded is a log parse operation binding the contract event 0x18fe0464eb77016dc4e227eb0d690e4002756d82b442143bbfb874548952b5f2. +// +// Solidity: event FeeRefunded(address token, address to, uint256 id, uint256 amount) +func (_NegRiskFees *NegRiskFeesFilterer) ParseFeeRefunded(log types.Log) (*NegRiskFeesFeeRefunded, error) { + event := new(NegRiskFeesFeeRefunded) + if err := _NegRiskFees.contract.UnpackLog(event, "FeeRefunded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskFeesFeeWithdrawnIterator is returned from FilterFeeWithdrawn and is used to iterate over the raw logs and unpacked data for FeeWithdrawn events raised by the NegRiskFees contract. +type NegRiskFeesFeeWithdrawnIterator struct { + Event *NegRiskFeesFeeWithdrawn // 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 *NegRiskFeesFeeWithdrawnIterator) 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(NegRiskFeesFeeWithdrawn) + 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(NegRiskFeesFeeWithdrawn) + 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 *NegRiskFeesFeeWithdrawnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskFeesFeeWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskFeesFeeWithdrawn represents a FeeWithdrawn event raised by the NegRiskFees contract. +type NegRiskFeesFeeWithdrawn struct { + Token common.Address + To common.Address + Id *big.Int + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeeWithdrawn is a free log retrieval operation binding the contract event 0x6ce49f8691a80db5eb4f60cd55b14640529346a7ddf9bf8f77a423fa6a10bfdb. +// +// Solidity: event FeeWithdrawn(address token, address to, uint256 id, uint256 amount) +func (_NegRiskFees *NegRiskFeesFilterer) FilterFeeWithdrawn(opts *bind.FilterOpts) (*NegRiskFeesFeeWithdrawnIterator, error) { + + logs, sub, err := _NegRiskFees.contract.FilterLogs(opts, "FeeWithdrawn") + if err != nil { + return nil, err + } + return &NegRiskFeesFeeWithdrawnIterator{contract: _NegRiskFees.contract, event: "FeeWithdrawn", logs: logs, sub: sub}, nil +} + +// WatchFeeWithdrawn is a free log subscription operation binding the contract event 0x6ce49f8691a80db5eb4f60cd55b14640529346a7ddf9bf8f77a423fa6a10bfdb. +// +// Solidity: event FeeWithdrawn(address token, address to, uint256 id, uint256 amount) +func (_NegRiskFees *NegRiskFeesFilterer) WatchFeeWithdrawn(opts *bind.WatchOpts, sink chan<- *NegRiskFeesFeeWithdrawn) (event.Subscription, error) { + + logs, sub, err := _NegRiskFees.contract.WatchLogs(opts, "FeeWithdrawn") + 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(NegRiskFeesFeeWithdrawn) + if err := _NegRiskFees.contract.UnpackLog(event, "FeeWithdrawn", 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 +} + +// ParseFeeWithdrawn is a log parse operation binding the contract event 0x6ce49f8691a80db5eb4f60cd55b14640529346a7ddf9bf8f77a423fa6a10bfdb. +// +// Solidity: event FeeWithdrawn(address token, address to, uint256 id, uint256 amount) +func (_NegRiskFees *NegRiskFeesFilterer) ParseFeeWithdrawn(log types.Log) (*NegRiskFeesFeeWithdrawn, error) { + event := new(NegRiskFeesFeeWithdrawn) + if err := _NegRiskFees.contract.UnpackLog(event, "FeeWithdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskFeesNewAdminIterator is returned from FilterNewAdmin and is used to iterate over the raw logs and unpacked data for NewAdmin events raised by the NegRiskFees contract. +type NegRiskFeesNewAdminIterator struct { + Event *NegRiskFeesNewAdmin // 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 *NegRiskFeesNewAdminIterator) 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(NegRiskFeesNewAdmin) + 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(NegRiskFeesNewAdmin) + 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 *NegRiskFeesNewAdminIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskFeesNewAdminIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskFeesNewAdmin represents a NewAdmin event raised by the NegRiskFees contract. +type NegRiskFeesNewAdmin struct { + Admin common.Address + NewAdminAddress common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewAdmin is a free log retrieval operation binding the contract event 0xf9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc. +// +// Solidity: event NewAdmin(address indexed admin, address indexed newAdminAddress) +func (_NegRiskFees *NegRiskFeesFilterer) FilterNewAdmin(opts *bind.FilterOpts, admin []common.Address, newAdminAddress []common.Address) (*NegRiskFeesNewAdminIterator, error) { + + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + var newAdminAddressRule []interface{} + for _, newAdminAddressItem := range newAdminAddress { + newAdminAddressRule = append(newAdminAddressRule, newAdminAddressItem) + } + + logs, sub, err := _NegRiskFees.contract.FilterLogs(opts, "NewAdmin", adminRule, newAdminAddressRule) + if err != nil { + return nil, err + } + return &NegRiskFeesNewAdminIterator{contract: _NegRiskFees.contract, event: "NewAdmin", logs: logs, sub: sub}, nil +} + +// WatchNewAdmin is a free log subscription operation binding the contract event 0xf9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc. +// +// Solidity: event NewAdmin(address indexed admin, address indexed newAdminAddress) +func (_NegRiskFees *NegRiskFeesFilterer) WatchNewAdmin(opts *bind.WatchOpts, sink chan<- *NegRiskFeesNewAdmin, admin []common.Address, newAdminAddress []common.Address) (event.Subscription, error) { + + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + var newAdminAddressRule []interface{} + for _, newAdminAddressItem := range newAdminAddress { + newAdminAddressRule = append(newAdminAddressRule, newAdminAddressItem) + } + + logs, sub, err := _NegRiskFees.contract.WatchLogs(opts, "NewAdmin", adminRule, newAdminAddressRule) + 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(NegRiskFeesNewAdmin) + if err := _NegRiskFees.contract.UnpackLog(event, "NewAdmin", 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 +} + +// ParseNewAdmin is a log parse operation binding the contract event 0xf9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc. +// +// Solidity: event NewAdmin(address indexed admin, address indexed newAdminAddress) +func (_NegRiskFees *NegRiskFeesFilterer) ParseNewAdmin(log types.Log) (*NegRiskFeesNewAdmin, error) { + event := new(NegRiskFeesNewAdmin) + if err := _NegRiskFees.contract.UnpackLog(event, "NewAdmin", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskFeesRemovedAdminIterator is returned from FilterRemovedAdmin and is used to iterate over the raw logs and unpacked data for RemovedAdmin events raised by the NegRiskFees contract. +type NegRiskFeesRemovedAdminIterator struct { + Event *NegRiskFeesRemovedAdmin // 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 *NegRiskFeesRemovedAdminIterator) 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(NegRiskFeesRemovedAdmin) + 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(NegRiskFeesRemovedAdmin) + 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 *NegRiskFeesRemovedAdminIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskFeesRemovedAdminIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskFeesRemovedAdmin represents a RemovedAdmin event raised by the NegRiskFees contract. +type NegRiskFeesRemovedAdmin struct { + Admin common.Address + RemovedAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemovedAdmin is a free log retrieval operation binding the contract event 0x787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e. +// +// Solidity: event RemovedAdmin(address indexed admin, address indexed removedAdmin) +func (_NegRiskFees *NegRiskFeesFilterer) FilterRemovedAdmin(opts *bind.FilterOpts, admin []common.Address, removedAdmin []common.Address) (*NegRiskFeesRemovedAdminIterator, error) { + + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + var removedAdminRule []interface{} + for _, removedAdminItem := range removedAdmin { + removedAdminRule = append(removedAdminRule, removedAdminItem) + } + + logs, sub, err := _NegRiskFees.contract.FilterLogs(opts, "RemovedAdmin", adminRule, removedAdminRule) + if err != nil { + return nil, err + } + return &NegRiskFeesRemovedAdminIterator{contract: _NegRiskFees.contract, event: "RemovedAdmin", logs: logs, sub: sub}, nil +} + +// WatchRemovedAdmin is a free log subscription operation binding the contract event 0x787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e. +// +// Solidity: event RemovedAdmin(address indexed admin, address indexed removedAdmin) +func (_NegRiskFees *NegRiskFeesFilterer) WatchRemovedAdmin(opts *bind.WatchOpts, sink chan<- *NegRiskFeesRemovedAdmin, admin []common.Address, removedAdmin []common.Address) (event.Subscription, error) { + + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + var removedAdminRule []interface{} + for _, removedAdminItem := range removedAdmin { + removedAdminRule = append(removedAdminRule, removedAdminItem) + } + + logs, sub, err := _NegRiskFees.contract.WatchLogs(opts, "RemovedAdmin", adminRule, removedAdminRule) + 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(NegRiskFeesRemovedAdmin) + if err := _NegRiskFees.contract.UnpackLog(event, "RemovedAdmin", 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 +} + +// ParseRemovedAdmin is a log parse operation binding the contract event 0x787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e. +// +// Solidity: event RemovedAdmin(address indexed admin, address indexed removedAdmin) +func (_NegRiskFees *NegRiskFeesFilterer) ParseRemovedAdmin(log types.Log) (*NegRiskFeesRemovedAdmin, error) { + event := new(NegRiskFeesRemovedAdmin) + if err := _NegRiskFees.contract.UnpackLog(event, "RemovedAdmin", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/pkg/contracts/neg-risk/neg_risk_exchange.go b/pkg/contracts/neg-risk/neg_risk_exchange.go new file mode 100644 index 0000000..a279c9c --- /dev/null +++ b/pkg/contracts/neg-risk/neg_risk_exchange.go @@ -0,0 +1,3566 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package neg_risk + +import ( + "errors" + "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 ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// Order is an auto generated low-level Go binding around an user-defined struct. +type Order struct { + Salt *big.Int + Maker common.Address + Signer common.Address + Taker common.Address + TokenId *big.Int + MakerAmount *big.Int + TakerAmount *big.Int + Expiration *big.Int + Nonce *big.Int + FeeRateBps *big.Int + Side uint8 + SignatureType uint8 + Signature []byte +} + +// OrderStatus is an auto generated low-level Go binding around an user-defined struct. +type OrderStatus struct { + IsFilledOrCancelled bool + Remaining *big.Int +} + +// NegRiskMetaData contains all meta data concerning the NegRisk contract. +var NegRiskMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_collateral\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ctf\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_negRiskAdapter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proxyFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_safeFactory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FeeTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidComplement\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenId\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MakingGtRemaining\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MismatchedTokenIds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAdmin\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotCrossing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotOperator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotTaker\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderFilledOrCancelled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Paused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooLittleTokensReceived\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeeCharged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdminAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"NewAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOperatorAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"NewOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"}],\"name\":\"OrderCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAmountFilled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAmountFilled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"OrderFilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"takerOrderHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"takerOrderMaker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAssetId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"makerAmountFilled\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"takerAmountFilled\",\"type\":\"uint256\"}],\"name\":\"OrdersMatched\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldProxyFactory\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newProxyFactory\",\"type\":\"address\"}],\"name\":\"ProxyFactoryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"RemovedAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"RemovedOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldSafeFactory\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newSafeFactory\",\"type\":\"address\"}],\"name\":\"SafeFactoryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"token0\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"token1\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"conditionId\",\"type\":\"bytes32\"}],\"name\":\"TokenRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pauser\",\"type\":\"address\"}],\"name\":\"TradingPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pauser\",\"type\":\"address\"}],\"name\":\"TradingUnpaused\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"name\":\"addAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator_\",\"type\":\"address\"}],\"name\":\"addOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"admins\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"cancelOrder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"orders\",\"type\":\"tuple[]\"}],\"name\":\"cancelOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"domainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"fillAmount\",\"type\":\"uint256\"}],\"name\":\"fillOrder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"orders\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"fillAmounts\",\"type\":\"uint256[]\"}],\"name\":\"fillOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCollateral\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"}],\"name\":\"getComplement\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"}],\"name\":\"getConditionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCtf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxFeeRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"}],\"name\":\"getOrderStatus\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"isFilledOrCancelled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"internalType\":\"structOrderStatus\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPolyProxyFactoryImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getPolyProxyWalletAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProxyFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getSafeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSafeFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSafeFactoryImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"hashOrder\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"incrementNonce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"}],\"name\":\"isOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"isValidNonce\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"takerOrder\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder[]\",\"name\":\"makerOrders\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"takerFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"makerFillAmounts\",\"type\":\"uint256[]\"}],\"name\":\"matchOrders\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"operators\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"orderStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isFilledOrCancelled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentCollectionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauseTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxyFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complement\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"conditionId\",\"type\":\"bytes32\"}],\"name\":\"registerToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"registry\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"complement\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"conditionId\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"removeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"removeOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceAdminRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOperatorRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safeFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newProxyFactory\",\"type\":\"address\"}],\"name\":\"setProxyFactory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newSafeFactory\",\"type\":\"address\"}],\"name\":\"setSafeFactory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpauseTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"complement\",\"type\":\"uint256\"}],\"name\":\"validateComplement\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"validateOrder\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"maker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"taker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"makerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"takerAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeRateBps\",\"type\":\"uint256\"},{\"internalType\":\"enumSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"enumSignatureType\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"validateOrderSignature\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"validateTokenId\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// NegRiskABI is the input ABI used to generate the binding from. +// Deprecated: Use NegRiskMetaData.ABI instead. +var NegRiskABI = NegRiskMetaData.ABI + +// NegRisk is an auto generated Go binding around an Ethereum contract. +type NegRisk struct { + NegRiskCaller // Read-only binding to the contract + NegRiskTransactor // Write-only binding to the contract + NegRiskFilterer // Log filterer for contract events +} + +// NegRiskCaller is an auto generated read-only Go binding around an Ethereum contract. +type NegRiskCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NegRiskTransactor is an auto generated write-only Go binding around an Ethereum contract. +type NegRiskTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NegRiskFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type NegRiskFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NegRiskSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type NegRiskSession struct { + Contract *NegRisk // 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 +} + +// NegRiskCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type NegRiskCallerSession struct { + Contract *NegRiskCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// NegRiskTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type NegRiskTransactorSession struct { + Contract *NegRiskTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// NegRiskRaw is an auto generated low-level Go binding around an Ethereum contract. +type NegRiskRaw struct { + Contract *NegRisk // Generic contract binding to access the raw methods on +} + +// NegRiskCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type NegRiskCallerRaw struct { + Contract *NegRiskCaller // Generic read-only contract binding to access the raw methods on +} + +// NegRiskTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type NegRiskTransactorRaw struct { + Contract *NegRiskTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewNegRisk creates a new instance of NegRisk, bound to a specific deployed contract. +func NewNegRisk(address common.Address, backend bind.ContractBackend) (*NegRisk, error) { + contract, err := bindNegRisk(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NegRisk{NegRiskCaller: NegRiskCaller{contract: contract}, NegRiskTransactor: NegRiskTransactor{contract: contract}, NegRiskFilterer: NegRiskFilterer{contract: contract}}, nil +} + +// NewNegRiskCaller creates a new read-only instance of NegRisk, bound to a specific deployed contract. +func NewNegRiskCaller(address common.Address, caller bind.ContractCaller) (*NegRiskCaller, error) { + contract, err := bindNegRisk(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NegRiskCaller{contract: contract}, nil +} + +// NewNegRiskTransactor creates a new write-only instance of NegRisk, bound to a specific deployed contract. +func NewNegRiskTransactor(address common.Address, transactor bind.ContractTransactor) (*NegRiskTransactor, error) { + contract, err := bindNegRisk(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NegRiskTransactor{contract: contract}, nil +} + +// NewNegRiskFilterer creates a new log filterer instance of NegRisk, bound to a specific deployed contract. +func NewNegRiskFilterer(address common.Address, filterer bind.ContractFilterer) (*NegRiskFilterer, error) { + contract, err := bindNegRisk(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NegRiskFilterer{contract: contract}, nil +} + +// bindNegRisk binds a generic wrapper to an already deployed contract. +func bindNegRisk(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := NegRiskMetaData.GetAbi() + 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 (_NegRisk *NegRiskRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NegRisk.Contract.NegRiskCaller.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 (_NegRisk *NegRiskRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRisk.Contract.NegRiskTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NegRisk *NegRiskRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NegRisk.Contract.NegRiskTransactor.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 (_NegRisk *NegRiskCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NegRisk.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 (_NegRisk *NegRiskTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRisk.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NegRisk *NegRiskTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NegRisk.Contract.contract.Transact(opts, method, params...) +} + +// Admins is a free data retrieval call binding the contract method 0x429b62e5. +// +// Solidity: function admins(address ) view returns(uint256) +func (_NegRisk *NegRiskCaller) Admins(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "admins", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Admins is a free data retrieval call binding the contract method 0x429b62e5. +// +// Solidity: function admins(address ) view returns(uint256) +func (_NegRisk *NegRiskSession) Admins(arg0 common.Address) (*big.Int, error) { + return _NegRisk.Contract.Admins(&_NegRisk.CallOpts, arg0) +} + +// Admins is a free data retrieval call binding the contract method 0x429b62e5. +// +// Solidity: function admins(address ) view returns(uint256) +func (_NegRisk *NegRiskCallerSession) Admins(arg0 common.Address) (*big.Int, error) { + return _NegRisk.Contract.Admins(&_NegRisk.CallOpts, arg0) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_NegRisk *NegRiskCaller) DomainSeparator(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "domainSeparator") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_NegRisk *NegRiskSession) DomainSeparator() ([32]byte, error) { + return _NegRisk.Contract.DomainSeparator(&_NegRisk.CallOpts) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_NegRisk *NegRiskCallerSession) DomainSeparator() ([32]byte, error) { + return _NegRisk.Contract.DomainSeparator(&_NegRisk.CallOpts) +} + +// GetCollateral is a free data retrieval call binding the contract method 0x5c1548fb. +// +// Solidity: function getCollateral() view returns(address) +func (_NegRisk *NegRiskCaller) GetCollateral(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getCollateral") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetCollateral is a free data retrieval call binding the contract method 0x5c1548fb. +// +// Solidity: function getCollateral() view returns(address) +func (_NegRisk *NegRiskSession) GetCollateral() (common.Address, error) { + return _NegRisk.Contract.GetCollateral(&_NegRisk.CallOpts) +} + +// GetCollateral is a free data retrieval call binding the contract method 0x5c1548fb. +// +// Solidity: function getCollateral() view returns(address) +func (_NegRisk *NegRiskCallerSession) GetCollateral() (common.Address, error) { + return _NegRisk.Contract.GetCollateral(&_NegRisk.CallOpts) +} + +// GetComplement is a free data retrieval call binding the contract method 0xa10f3dce. +// +// Solidity: function getComplement(uint256 token) view returns(uint256) +func (_NegRisk *NegRiskCaller) GetComplement(opts *bind.CallOpts, token *big.Int) (*big.Int, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getComplement", token) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetComplement is a free data retrieval call binding the contract method 0xa10f3dce. +// +// Solidity: function getComplement(uint256 token) view returns(uint256) +func (_NegRisk *NegRiskSession) GetComplement(token *big.Int) (*big.Int, error) { + return _NegRisk.Contract.GetComplement(&_NegRisk.CallOpts, token) +} + +// GetComplement is a free data retrieval call binding the contract method 0xa10f3dce. +// +// Solidity: function getComplement(uint256 token) view returns(uint256) +func (_NegRisk *NegRiskCallerSession) GetComplement(token *big.Int) (*big.Int, error) { + return _NegRisk.Contract.GetComplement(&_NegRisk.CallOpts, token) +} + +// GetConditionId is a free data retrieval call binding the contract method 0xd7fb272f. +// +// Solidity: function getConditionId(uint256 token) view returns(bytes32) +func (_NegRisk *NegRiskCaller) GetConditionId(opts *bind.CallOpts, token *big.Int) ([32]byte, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getConditionId", token) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetConditionId is a free data retrieval call binding the contract method 0xd7fb272f. +// +// Solidity: function getConditionId(uint256 token) view returns(bytes32) +func (_NegRisk *NegRiskSession) GetConditionId(token *big.Int) ([32]byte, error) { + return _NegRisk.Contract.GetConditionId(&_NegRisk.CallOpts, token) +} + +// GetConditionId is a free data retrieval call binding the contract method 0xd7fb272f. +// +// Solidity: function getConditionId(uint256 token) view returns(bytes32) +func (_NegRisk *NegRiskCallerSession) GetConditionId(token *big.Int) ([32]byte, error) { + return _NegRisk.Contract.GetConditionId(&_NegRisk.CallOpts, token) +} + +// GetCtf is a free data retrieval call binding the contract method 0x3b521d78. +// +// Solidity: function getCtf() view returns(address) +func (_NegRisk *NegRiskCaller) GetCtf(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getCtf") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetCtf is a free data retrieval call binding the contract method 0x3b521d78. +// +// Solidity: function getCtf() view returns(address) +func (_NegRisk *NegRiskSession) GetCtf() (common.Address, error) { + return _NegRisk.Contract.GetCtf(&_NegRisk.CallOpts) +} + +// GetCtf is a free data retrieval call binding the contract method 0x3b521d78. +// +// Solidity: function getCtf() view returns(address) +func (_NegRisk *NegRiskCallerSession) GetCtf() (common.Address, error) { + return _NegRisk.Contract.GetCtf(&_NegRisk.CallOpts) +} + +// GetMaxFeeRate is a free data retrieval call binding the contract method 0x4a2a11f5. +// +// Solidity: function getMaxFeeRate() pure returns(uint256) +func (_NegRisk *NegRiskCaller) GetMaxFeeRate(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getMaxFeeRate") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMaxFeeRate is a free data retrieval call binding the contract method 0x4a2a11f5. +// +// Solidity: function getMaxFeeRate() pure returns(uint256) +func (_NegRisk *NegRiskSession) GetMaxFeeRate() (*big.Int, error) { + return _NegRisk.Contract.GetMaxFeeRate(&_NegRisk.CallOpts) +} + +// GetMaxFeeRate is a free data retrieval call binding the contract method 0x4a2a11f5. +// +// Solidity: function getMaxFeeRate() pure returns(uint256) +func (_NegRisk *NegRiskCallerSession) GetMaxFeeRate() (*big.Int, error) { + return _NegRisk.Contract.GetMaxFeeRate(&_NegRisk.CallOpts) +} + +// GetOrderStatus is a free data retrieval call binding the contract method 0x46423aa7. +// +// Solidity: function getOrderStatus(bytes32 orderHash) view returns((bool,uint256)) +func (_NegRisk *NegRiskCaller) GetOrderStatus(opts *bind.CallOpts, orderHash [32]byte) (OrderStatus, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getOrderStatus", orderHash) + + if err != nil { + return *new(OrderStatus), err + } + + out0 := *abi.ConvertType(out[0], new(OrderStatus)).(*OrderStatus) + + return out0, err + +} + +// GetOrderStatus is a free data retrieval call binding the contract method 0x46423aa7. +// +// Solidity: function getOrderStatus(bytes32 orderHash) view returns((bool,uint256)) +func (_NegRisk *NegRiskSession) GetOrderStatus(orderHash [32]byte) (OrderStatus, error) { + return _NegRisk.Contract.GetOrderStatus(&_NegRisk.CallOpts, orderHash) +} + +// GetOrderStatus is a free data retrieval call binding the contract method 0x46423aa7. +// +// Solidity: function getOrderStatus(bytes32 orderHash) view returns((bool,uint256)) +func (_NegRisk *NegRiskCallerSession) GetOrderStatus(orderHash [32]byte) (OrderStatus, error) { + return _NegRisk.Contract.GetOrderStatus(&_NegRisk.CallOpts, orderHash) +} + +// GetPolyProxyFactoryImplementation is a free data retrieval call binding the contract method 0x06b9d691. +// +// Solidity: function getPolyProxyFactoryImplementation() view returns(address) +func (_NegRisk *NegRiskCaller) GetPolyProxyFactoryImplementation(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getPolyProxyFactoryImplementation") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetPolyProxyFactoryImplementation is a free data retrieval call binding the contract method 0x06b9d691. +// +// Solidity: function getPolyProxyFactoryImplementation() view returns(address) +func (_NegRisk *NegRiskSession) GetPolyProxyFactoryImplementation() (common.Address, error) { + return _NegRisk.Contract.GetPolyProxyFactoryImplementation(&_NegRisk.CallOpts) +} + +// GetPolyProxyFactoryImplementation is a free data retrieval call binding the contract method 0x06b9d691. +// +// Solidity: function getPolyProxyFactoryImplementation() view returns(address) +func (_NegRisk *NegRiskCallerSession) GetPolyProxyFactoryImplementation() (common.Address, error) { + return _NegRisk.Contract.GetPolyProxyFactoryImplementation(&_NegRisk.CallOpts) +} + +// GetPolyProxyWalletAddress is a free data retrieval call binding the contract method 0xedef7d8e. +// +// Solidity: function getPolyProxyWalletAddress(address _addr) view returns(address) +func (_NegRisk *NegRiskCaller) GetPolyProxyWalletAddress(opts *bind.CallOpts, _addr common.Address) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getPolyProxyWalletAddress", _addr) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetPolyProxyWalletAddress is a free data retrieval call binding the contract method 0xedef7d8e. +// +// Solidity: function getPolyProxyWalletAddress(address _addr) view returns(address) +func (_NegRisk *NegRiskSession) GetPolyProxyWalletAddress(_addr common.Address) (common.Address, error) { + return _NegRisk.Contract.GetPolyProxyWalletAddress(&_NegRisk.CallOpts, _addr) +} + +// GetPolyProxyWalletAddress is a free data retrieval call binding the contract method 0xedef7d8e. +// +// Solidity: function getPolyProxyWalletAddress(address _addr) view returns(address) +func (_NegRisk *NegRiskCallerSession) GetPolyProxyWalletAddress(_addr common.Address) (common.Address, error) { + return _NegRisk.Contract.GetPolyProxyWalletAddress(&_NegRisk.CallOpts, _addr) +} + +// GetProxyFactory is a free data retrieval call binding the contract method 0xb28c51c0. +// +// Solidity: function getProxyFactory() view returns(address) +func (_NegRisk *NegRiskCaller) GetProxyFactory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getProxyFactory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetProxyFactory is a free data retrieval call binding the contract method 0xb28c51c0. +// +// Solidity: function getProxyFactory() view returns(address) +func (_NegRisk *NegRiskSession) GetProxyFactory() (common.Address, error) { + return _NegRisk.Contract.GetProxyFactory(&_NegRisk.CallOpts) +} + +// GetProxyFactory is a free data retrieval call binding the contract method 0xb28c51c0. +// +// Solidity: function getProxyFactory() view returns(address) +func (_NegRisk *NegRiskCallerSession) GetProxyFactory() (common.Address, error) { + return _NegRisk.Contract.GetProxyFactory(&_NegRisk.CallOpts) +} + +// GetSafeAddress is a free data retrieval call binding the contract method 0xa287bdf1. +// +// Solidity: function getSafeAddress(address _addr) view returns(address) +func (_NegRisk *NegRiskCaller) GetSafeAddress(opts *bind.CallOpts, _addr common.Address) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getSafeAddress", _addr) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetSafeAddress is a free data retrieval call binding the contract method 0xa287bdf1. +// +// Solidity: function getSafeAddress(address _addr) view returns(address) +func (_NegRisk *NegRiskSession) GetSafeAddress(_addr common.Address) (common.Address, error) { + return _NegRisk.Contract.GetSafeAddress(&_NegRisk.CallOpts, _addr) +} + +// GetSafeAddress is a free data retrieval call binding the contract method 0xa287bdf1. +// +// Solidity: function getSafeAddress(address _addr) view returns(address) +func (_NegRisk *NegRiskCallerSession) GetSafeAddress(_addr common.Address) (common.Address, error) { + return _NegRisk.Contract.GetSafeAddress(&_NegRisk.CallOpts, _addr) +} + +// GetSafeFactory is a free data retrieval call binding the contract method 0x75d7370a. +// +// Solidity: function getSafeFactory() view returns(address) +func (_NegRisk *NegRiskCaller) GetSafeFactory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getSafeFactory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetSafeFactory is a free data retrieval call binding the contract method 0x75d7370a. +// +// Solidity: function getSafeFactory() view returns(address) +func (_NegRisk *NegRiskSession) GetSafeFactory() (common.Address, error) { + return _NegRisk.Contract.GetSafeFactory(&_NegRisk.CallOpts) +} + +// GetSafeFactory is a free data retrieval call binding the contract method 0x75d7370a. +// +// Solidity: function getSafeFactory() view returns(address) +func (_NegRisk *NegRiskCallerSession) GetSafeFactory() (common.Address, error) { + return _NegRisk.Contract.GetSafeFactory(&_NegRisk.CallOpts) +} + +// GetSafeFactoryImplementation is a free data retrieval call binding the contract method 0xe03ac3d0. +// +// Solidity: function getSafeFactoryImplementation() view returns(address) +func (_NegRisk *NegRiskCaller) GetSafeFactoryImplementation(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "getSafeFactoryImplementation") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetSafeFactoryImplementation is a free data retrieval call binding the contract method 0xe03ac3d0. +// +// Solidity: function getSafeFactoryImplementation() view returns(address) +func (_NegRisk *NegRiskSession) GetSafeFactoryImplementation() (common.Address, error) { + return _NegRisk.Contract.GetSafeFactoryImplementation(&_NegRisk.CallOpts) +} + +// GetSafeFactoryImplementation is a free data retrieval call binding the contract method 0xe03ac3d0. +// +// Solidity: function getSafeFactoryImplementation() view returns(address) +func (_NegRisk *NegRiskCallerSession) GetSafeFactoryImplementation() (common.Address, error) { + return _NegRisk.Contract.GetSafeFactoryImplementation(&_NegRisk.CallOpts) +} + +// HashOrder is a free data retrieval call binding the contract method 0xe50e4f97. +// +// Solidity: function hashOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) view returns(bytes32) +func (_NegRisk *NegRiskCaller) HashOrder(opts *bind.CallOpts, order Order) ([32]byte, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "hashOrder", order) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// HashOrder is a free data retrieval call binding the contract method 0xe50e4f97. +// +// Solidity: function hashOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) view returns(bytes32) +func (_NegRisk *NegRiskSession) HashOrder(order Order) ([32]byte, error) { + return _NegRisk.Contract.HashOrder(&_NegRisk.CallOpts, order) +} + +// HashOrder is a free data retrieval call binding the contract method 0xe50e4f97. +// +// Solidity: function hashOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) view returns(bytes32) +func (_NegRisk *NegRiskCallerSession) HashOrder(order Order) ([32]byte, error) { + return _NegRisk.Contract.HashOrder(&_NegRisk.CallOpts, order) +} + +// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. +// +// Solidity: function isAdmin(address usr) view returns(bool) +func (_NegRisk *NegRiskCaller) IsAdmin(opts *bind.CallOpts, usr common.Address) (bool, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "isAdmin", usr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. +// +// Solidity: function isAdmin(address usr) view returns(bool) +func (_NegRisk *NegRiskSession) IsAdmin(usr common.Address) (bool, error) { + return _NegRisk.Contract.IsAdmin(&_NegRisk.CallOpts, usr) +} + +// IsAdmin is a free data retrieval call binding the contract method 0x24d7806c. +// +// Solidity: function isAdmin(address usr) view returns(bool) +func (_NegRisk *NegRiskCallerSession) IsAdmin(usr common.Address) (bool, error) { + return _NegRisk.Contract.IsAdmin(&_NegRisk.CallOpts, usr) +} + +// IsOperator is a free data retrieval call binding the contract method 0x6d70f7ae. +// +// Solidity: function isOperator(address usr) view returns(bool) +func (_NegRisk *NegRiskCaller) IsOperator(opts *bind.CallOpts, usr common.Address) (bool, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "isOperator", usr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOperator is a free data retrieval call binding the contract method 0x6d70f7ae. +// +// Solidity: function isOperator(address usr) view returns(bool) +func (_NegRisk *NegRiskSession) IsOperator(usr common.Address) (bool, error) { + return _NegRisk.Contract.IsOperator(&_NegRisk.CallOpts, usr) +} + +// IsOperator is a free data retrieval call binding the contract method 0x6d70f7ae. +// +// Solidity: function isOperator(address usr) view returns(bool) +func (_NegRisk *NegRiskCallerSession) IsOperator(usr common.Address) (bool, error) { + return _NegRisk.Contract.IsOperator(&_NegRisk.CallOpts, usr) +} + +// IsValidNonce is a free data retrieval call binding the contract method 0x0647ee20. +// +// Solidity: function isValidNonce(address usr, uint256 nonce) view returns(bool) +func (_NegRisk *NegRiskCaller) IsValidNonce(opts *bind.CallOpts, usr common.Address, nonce *big.Int) (bool, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "isValidNonce", usr, nonce) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsValidNonce is a free data retrieval call binding the contract method 0x0647ee20. +// +// Solidity: function isValidNonce(address usr, uint256 nonce) view returns(bool) +func (_NegRisk *NegRiskSession) IsValidNonce(usr common.Address, nonce *big.Int) (bool, error) { + return _NegRisk.Contract.IsValidNonce(&_NegRisk.CallOpts, usr, nonce) +} + +// IsValidNonce is a free data retrieval call binding the contract method 0x0647ee20. +// +// Solidity: function isValidNonce(address usr, uint256 nonce) view returns(bool) +func (_NegRisk *NegRiskCallerSession) IsValidNonce(usr common.Address, nonce *big.Int) (bool, error) { + return _NegRisk.Contract.IsValidNonce(&_NegRisk.CallOpts, usr, nonce) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address ) view returns(uint256) +func (_NegRisk *NegRiskCaller) Nonces(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "nonces", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address ) view returns(uint256) +func (_NegRisk *NegRiskSession) Nonces(arg0 common.Address) (*big.Int, error) { + return _NegRisk.Contract.Nonces(&_NegRisk.CallOpts, arg0) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address ) view returns(uint256) +func (_NegRisk *NegRiskCallerSession) Nonces(arg0 common.Address) (*big.Int, error) { + return _NegRisk.Contract.Nonces(&_NegRisk.CallOpts, arg0) +} + +// Operators is a free data retrieval call binding the contract method 0x13e7c9d8. +// +// Solidity: function operators(address ) view returns(uint256) +func (_NegRisk *NegRiskCaller) Operators(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "operators", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Operators is a free data retrieval call binding the contract method 0x13e7c9d8. +// +// Solidity: function operators(address ) view returns(uint256) +func (_NegRisk *NegRiskSession) Operators(arg0 common.Address) (*big.Int, error) { + return _NegRisk.Contract.Operators(&_NegRisk.CallOpts, arg0) +} + +// Operators is a free data retrieval call binding the contract method 0x13e7c9d8. +// +// Solidity: function operators(address ) view returns(uint256) +func (_NegRisk *NegRiskCallerSession) Operators(arg0 common.Address) (*big.Int, error) { + return _NegRisk.Contract.Operators(&_NegRisk.CallOpts, arg0) +} + +// OrderStatus is a free data retrieval call binding the contract method 0x2dff692d. +// +// Solidity: function orderStatus(bytes32 ) view returns(bool isFilledOrCancelled, uint256 remaining) +func (_NegRisk *NegRiskCaller) OrderStatus(opts *bind.CallOpts, arg0 [32]byte) (struct { + IsFilledOrCancelled bool + Remaining *big.Int +}, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "orderStatus", arg0) + + outstruct := new(struct { + IsFilledOrCancelled bool + Remaining *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.IsFilledOrCancelled = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.Remaining = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// OrderStatus is a free data retrieval call binding the contract method 0x2dff692d. +// +// Solidity: function orderStatus(bytes32 ) view returns(bool isFilledOrCancelled, uint256 remaining) +func (_NegRisk *NegRiskSession) OrderStatus(arg0 [32]byte) (struct { + IsFilledOrCancelled bool + Remaining *big.Int +}, error) { + return _NegRisk.Contract.OrderStatus(&_NegRisk.CallOpts, arg0) +} + +// OrderStatus is a free data retrieval call binding the contract method 0x2dff692d. +// +// Solidity: function orderStatus(bytes32 ) view returns(bool isFilledOrCancelled, uint256 remaining) +func (_NegRisk *NegRiskCallerSession) OrderStatus(arg0 [32]byte) (struct { + IsFilledOrCancelled bool + Remaining *big.Int +}, error) { + return _NegRisk.Contract.OrderStatus(&_NegRisk.CallOpts, arg0) +} + +// ParentCollectionId is a free data retrieval call binding the contract method 0x44bea37e. +// +// Solidity: function parentCollectionId() view returns(bytes32) +func (_NegRisk *NegRiskCaller) ParentCollectionId(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "parentCollectionId") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ParentCollectionId is a free data retrieval call binding the contract method 0x44bea37e. +// +// Solidity: function parentCollectionId() view returns(bytes32) +func (_NegRisk *NegRiskSession) ParentCollectionId() ([32]byte, error) { + return _NegRisk.Contract.ParentCollectionId(&_NegRisk.CallOpts) +} + +// ParentCollectionId is a free data retrieval call binding the contract method 0x44bea37e. +// +// Solidity: function parentCollectionId() view returns(bytes32) +func (_NegRisk *NegRiskCallerSession) ParentCollectionId() ([32]byte, error) { + return _NegRisk.Contract.ParentCollectionId(&_NegRisk.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_NegRisk *NegRiskCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_NegRisk *NegRiskSession) Paused() (bool, error) { + return _NegRisk.Contract.Paused(&_NegRisk.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_NegRisk *NegRiskCallerSession) Paused() (bool, error) { + return _NegRisk.Contract.Paused(&_NegRisk.CallOpts) +} + +// ProxyFactory is a free data retrieval call binding the contract method 0xc10f1a75. +// +// Solidity: function proxyFactory() view returns(address) +func (_NegRisk *NegRiskCaller) ProxyFactory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "proxyFactory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ProxyFactory is a free data retrieval call binding the contract method 0xc10f1a75. +// +// Solidity: function proxyFactory() view returns(address) +func (_NegRisk *NegRiskSession) ProxyFactory() (common.Address, error) { + return _NegRisk.Contract.ProxyFactory(&_NegRisk.CallOpts) +} + +// ProxyFactory is a free data retrieval call binding the contract method 0xc10f1a75. +// +// Solidity: function proxyFactory() view returns(address) +func (_NegRisk *NegRiskCallerSession) ProxyFactory() (common.Address, error) { + return _NegRisk.Contract.ProxyFactory(&_NegRisk.CallOpts) +} + +// Registry is a free data retrieval call binding the contract method 0x5893253c. +// +// Solidity: function registry(uint256 ) view returns(uint256 complement, bytes32 conditionId) +func (_NegRisk *NegRiskCaller) Registry(opts *bind.CallOpts, arg0 *big.Int) (struct { + Complement *big.Int + ConditionId [32]byte +}, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "registry", arg0) + + outstruct := new(struct { + Complement *big.Int + ConditionId [32]byte + }) + if err != nil { + return *outstruct, err + } + + outstruct.Complement = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.ConditionId = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +// Registry is a free data retrieval call binding the contract method 0x5893253c. +// +// Solidity: function registry(uint256 ) view returns(uint256 complement, bytes32 conditionId) +func (_NegRisk *NegRiskSession) Registry(arg0 *big.Int) (struct { + Complement *big.Int + ConditionId [32]byte +}, error) { + return _NegRisk.Contract.Registry(&_NegRisk.CallOpts, arg0) +} + +// Registry is a free data retrieval call binding the contract method 0x5893253c. +// +// Solidity: function registry(uint256 ) view returns(uint256 complement, bytes32 conditionId) +func (_NegRisk *NegRiskCallerSession) Registry(arg0 *big.Int) (struct { + Complement *big.Int + ConditionId [32]byte +}, error) { + return _NegRisk.Contract.Registry(&_NegRisk.CallOpts, arg0) +} + +// SafeFactory is a free data retrieval call binding the contract method 0x131e7e1c. +// +// Solidity: function safeFactory() view returns(address) +func (_NegRisk *NegRiskCaller) SafeFactory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "safeFactory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SafeFactory is a free data retrieval call binding the contract method 0x131e7e1c. +// +// Solidity: function safeFactory() view returns(address) +func (_NegRisk *NegRiskSession) SafeFactory() (common.Address, error) { + return _NegRisk.Contract.SafeFactory(&_NegRisk.CallOpts) +} + +// SafeFactory is a free data retrieval call binding the contract method 0x131e7e1c. +// +// Solidity: function safeFactory() view returns(address) +func (_NegRisk *NegRiskCallerSession) SafeFactory() (common.Address, error) { + return _NegRisk.Contract.SafeFactory(&_NegRisk.CallOpts) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_NegRisk *NegRiskCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_NegRisk *NegRiskSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _NegRisk.Contract.SupportsInterface(&_NegRisk.CallOpts, interfaceId) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_NegRisk *NegRiskCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _NegRisk.Contract.SupportsInterface(&_NegRisk.CallOpts, interfaceId) +} + +// ValidateComplement is a free data retrieval call binding the contract method 0xd82da838. +// +// Solidity: function validateComplement(uint256 token, uint256 complement) view returns() +func (_NegRisk *NegRiskCaller) ValidateComplement(opts *bind.CallOpts, token *big.Int, complement *big.Int) error { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "validateComplement", token, complement) + + if err != nil { + return err + } + + return err + +} + +// ValidateComplement is a free data retrieval call binding the contract method 0xd82da838. +// +// Solidity: function validateComplement(uint256 token, uint256 complement) view returns() +func (_NegRisk *NegRiskSession) ValidateComplement(token *big.Int, complement *big.Int) error { + return _NegRisk.Contract.ValidateComplement(&_NegRisk.CallOpts, token, complement) +} + +// ValidateComplement is a free data retrieval call binding the contract method 0xd82da838. +// +// Solidity: function validateComplement(uint256 token, uint256 complement) view returns() +func (_NegRisk *NegRiskCallerSession) ValidateComplement(token *big.Int, complement *big.Int) error { + return _NegRisk.Contract.ValidateComplement(&_NegRisk.CallOpts, token, complement) +} + +// ValidateOrder is a free data retrieval call binding the contract method 0x654f0ce4. +// +// Solidity: function validateOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) view returns() +func (_NegRisk *NegRiskCaller) ValidateOrder(opts *bind.CallOpts, order Order) error { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "validateOrder", order) + + if err != nil { + return err + } + + return err + +} + +// ValidateOrder is a free data retrieval call binding the contract method 0x654f0ce4. +// +// Solidity: function validateOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) view returns() +func (_NegRisk *NegRiskSession) ValidateOrder(order Order) error { + return _NegRisk.Contract.ValidateOrder(&_NegRisk.CallOpts, order) +} + +// ValidateOrder is a free data retrieval call binding the contract method 0x654f0ce4. +// +// Solidity: function validateOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) view returns() +func (_NegRisk *NegRiskCallerSession) ValidateOrder(order Order) error { + return _NegRisk.Contract.ValidateOrder(&_NegRisk.CallOpts, order) +} + +// ValidateOrderSignature is a free data retrieval call binding the contract method 0xe2eec405. +// +// Solidity: function validateOrderSignature(bytes32 orderHash, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) view returns() +func (_NegRisk *NegRiskCaller) ValidateOrderSignature(opts *bind.CallOpts, orderHash [32]byte, order Order) error { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "validateOrderSignature", orderHash, order) + + if err != nil { + return err + } + + return err + +} + +// ValidateOrderSignature is a free data retrieval call binding the contract method 0xe2eec405. +// +// Solidity: function validateOrderSignature(bytes32 orderHash, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) view returns() +func (_NegRisk *NegRiskSession) ValidateOrderSignature(orderHash [32]byte, order Order) error { + return _NegRisk.Contract.ValidateOrderSignature(&_NegRisk.CallOpts, orderHash, order) +} + +// ValidateOrderSignature is a free data retrieval call binding the contract method 0xe2eec405. +// +// Solidity: function validateOrderSignature(bytes32 orderHash, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) view returns() +func (_NegRisk *NegRiskCallerSession) ValidateOrderSignature(orderHash [32]byte, order Order) error { + return _NegRisk.Contract.ValidateOrderSignature(&_NegRisk.CallOpts, orderHash, order) +} + +// ValidateTokenId is a free data retrieval call binding the contract method 0x34600901. +// +// Solidity: function validateTokenId(uint256 tokenId) view returns() +func (_NegRisk *NegRiskCaller) ValidateTokenId(opts *bind.CallOpts, tokenId *big.Int) error { + var out []interface{} + err := _NegRisk.contract.Call(opts, &out, "validateTokenId", tokenId) + + if err != nil { + return err + } + + return err + +} + +// ValidateTokenId is a free data retrieval call binding the contract method 0x34600901. +// +// Solidity: function validateTokenId(uint256 tokenId) view returns() +func (_NegRisk *NegRiskSession) ValidateTokenId(tokenId *big.Int) error { + return _NegRisk.Contract.ValidateTokenId(&_NegRisk.CallOpts, tokenId) +} + +// ValidateTokenId is a free data retrieval call binding the contract method 0x34600901. +// +// Solidity: function validateTokenId(uint256 tokenId) view returns() +func (_NegRisk *NegRiskCallerSession) ValidateTokenId(tokenId *big.Int) error { + return _NegRisk.Contract.ValidateTokenId(&_NegRisk.CallOpts, tokenId) +} + +// AddAdmin is a paid mutator transaction binding the contract method 0x70480275. +// +// Solidity: function addAdmin(address admin_) returns() +func (_NegRisk *NegRiskTransactor) AddAdmin(opts *bind.TransactOpts, admin_ common.Address) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "addAdmin", admin_) +} + +// AddAdmin is a paid mutator transaction binding the contract method 0x70480275. +// +// Solidity: function addAdmin(address admin_) returns() +func (_NegRisk *NegRiskSession) AddAdmin(admin_ common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.AddAdmin(&_NegRisk.TransactOpts, admin_) +} + +// AddAdmin is a paid mutator transaction binding the contract method 0x70480275. +// +// Solidity: function addAdmin(address admin_) returns() +func (_NegRisk *NegRiskTransactorSession) AddAdmin(admin_ common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.AddAdmin(&_NegRisk.TransactOpts, admin_) +} + +// AddOperator is a paid mutator transaction binding the contract method 0x9870d7fe. +// +// Solidity: function addOperator(address operator_) returns() +func (_NegRisk *NegRiskTransactor) AddOperator(opts *bind.TransactOpts, operator_ common.Address) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "addOperator", operator_) +} + +// AddOperator is a paid mutator transaction binding the contract method 0x9870d7fe. +// +// Solidity: function addOperator(address operator_) returns() +func (_NegRisk *NegRiskSession) AddOperator(operator_ common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.AddOperator(&_NegRisk.TransactOpts, operator_) +} + +// AddOperator is a paid mutator transaction binding the contract method 0x9870d7fe. +// +// Solidity: function addOperator(address operator_) returns() +func (_NegRisk *NegRiskTransactorSession) AddOperator(operator_ common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.AddOperator(&_NegRisk.TransactOpts, operator_) +} + +// CancelOrder is a paid mutator transaction binding the contract method 0xa6dfcf86. +// +// Solidity: function cancelOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) returns() +func (_NegRisk *NegRiskTransactor) CancelOrder(opts *bind.TransactOpts, order Order) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "cancelOrder", order) +} + +// CancelOrder is a paid mutator transaction binding the contract method 0xa6dfcf86. +// +// Solidity: function cancelOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) returns() +func (_NegRisk *NegRiskSession) CancelOrder(order Order) (*types.Transaction, error) { + return _NegRisk.Contract.CancelOrder(&_NegRisk.TransactOpts, order) +} + +// CancelOrder is a paid mutator transaction binding the contract method 0xa6dfcf86. +// +// Solidity: function cancelOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order) returns() +func (_NegRisk *NegRiskTransactorSession) CancelOrder(order Order) (*types.Transaction, error) { + return _NegRisk.Contract.CancelOrder(&_NegRisk.TransactOpts, order) +} + +// CancelOrders is a paid mutator transaction binding the contract method 0xfa950b48. +// +// Solidity: function cancelOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] orders) returns() +func (_NegRisk *NegRiskTransactor) CancelOrders(opts *bind.TransactOpts, orders []Order) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "cancelOrders", orders) +} + +// CancelOrders is a paid mutator transaction binding the contract method 0xfa950b48. +// +// Solidity: function cancelOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] orders) returns() +func (_NegRisk *NegRiskSession) CancelOrders(orders []Order) (*types.Transaction, error) { + return _NegRisk.Contract.CancelOrders(&_NegRisk.TransactOpts, orders) +} + +// CancelOrders is a paid mutator transaction binding the contract method 0xfa950b48. +// +// Solidity: function cancelOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] orders) returns() +func (_NegRisk *NegRiskTransactorSession) CancelOrders(orders []Order) (*types.Transaction, error) { + return _NegRisk.Contract.CancelOrders(&_NegRisk.TransactOpts, orders) +} + +// FillOrder is a paid mutator transaction binding the contract method 0xfe729aaf. +// +// Solidity: function fillOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order, uint256 fillAmount) returns() +func (_NegRisk *NegRiskTransactor) FillOrder(opts *bind.TransactOpts, order Order, fillAmount *big.Int) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "fillOrder", order, fillAmount) +} + +// FillOrder is a paid mutator transaction binding the contract method 0xfe729aaf. +// +// Solidity: function fillOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order, uint256 fillAmount) returns() +func (_NegRisk *NegRiskSession) FillOrder(order Order, fillAmount *big.Int) (*types.Transaction, error) { + return _NegRisk.Contract.FillOrder(&_NegRisk.TransactOpts, order, fillAmount) +} + +// FillOrder is a paid mutator transaction binding the contract method 0xfe729aaf. +// +// Solidity: function fillOrder((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) order, uint256 fillAmount) returns() +func (_NegRisk *NegRiskTransactorSession) FillOrder(order Order, fillAmount *big.Int) (*types.Transaction, error) { + return _NegRisk.Contract.FillOrder(&_NegRisk.TransactOpts, order, fillAmount) +} + +// FillOrders is a paid mutator transaction binding the contract method 0xd798eff6. +// +// Solidity: function fillOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] orders, uint256[] fillAmounts) returns() +func (_NegRisk *NegRiskTransactor) FillOrders(opts *bind.TransactOpts, orders []Order, fillAmounts []*big.Int) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "fillOrders", orders, fillAmounts) +} + +// FillOrders is a paid mutator transaction binding the contract method 0xd798eff6. +// +// Solidity: function fillOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] orders, uint256[] fillAmounts) returns() +func (_NegRisk *NegRiskSession) FillOrders(orders []Order, fillAmounts []*big.Int) (*types.Transaction, error) { + return _NegRisk.Contract.FillOrders(&_NegRisk.TransactOpts, orders, fillAmounts) +} + +// FillOrders is a paid mutator transaction binding the contract method 0xd798eff6. +// +// Solidity: function fillOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] orders, uint256[] fillAmounts) returns() +func (_NegRisk *NegRiskTransactorSession) FillOrders(orders []Order, fillAmounts []*big.Int) (*types.Transaction, error) { + return _NegRisk.Contract.FillOrders(&_NegRisk.TransactOpts, orders, fillAmounts) +} + +// IncrementNonce is a paid mutator transaction binding the contract method 0x627cdcb9. +// +// Solidity: function incrementNonce() returns() +func (_NegRisk *NegRiskTransactor) IncrementNonce(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "incrementNonce") +} + +// IncrementNonce is a paid mutator transaction binding the contract method 0x627cdcb9. +// +// Solidity: function incrementNonce() returns() +func (_NegRisk *NegRiskSession) IncrementNonce() (*types.Transaction, error) { + return _NegRisk.Contract.IncrementNonce(&_NegRisk.TransactOpts) +} + +// IncrementNonce is a paid mutator transaction binding the contract method 0x627cdcb9. +// +// Solidity: function incrementNonce() returns() +func (_NegRisk *NegRiskTransactorSession) IncrementNonce() (*types.Transaction, error) { + return _NegRisk.Contract.IncrementNonce(&_NegRisk.TransactOpts) +} + +// MatchOrders is a paid mutator transaction binding the contract method 0xe60f0c05. +// +// Solidity: function matchOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) takerOrder, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts) returns() +func (_NegRisk *NegRiskTransactor) MatchOrders(opts *bind.TransactOpts, takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "matchOrders", takerOrder, makerOrders, takerFillAmount, makerFillAmounts) +} + +// MatchOrders is a paid mutator transaction binding the contract method 0xe60f0c05. +// +// Solidity: function matchOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) takerOrder, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts) returns() +func (_NegRisk *NegRiskSession) MatchOrders(takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int) (*types.Transaction, error) { + return _NegRisk.Contract.MatchOrders(&_NegRisk.TransactOpts, takerOrder, makerOrders, takerFillAmount, makerFillAmounts) +} + +// MatchOrders is a paid mutator transaction binding the contract method 0xe60f0c05. +// +// Solidity: function matchOrders((uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes) takerOrder, (uint256,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8,uint8,bytes)[] makerOrders, uint256 takerFillAmount, uint256[] makerFillAmounts) returns() +func (_NegRisk *NegRiskTransactorSession) MatchOrders(takerOrder Order, makerOrders []Order, takerFillAmount *big.Int, makerFillAmounts []*big.Int) (*types.Transaction, error) { + return _NegRisk.Contract.MatchOrders(&_NegRisk.TransactOpts, takerOrder, makerOrders, takerFillAmount, makerFillAmounts) +} + +// OnERC1155BatchReceived is a paid mutator transaction binding the contract method 0xbc197c81. +// +// Solidity: function onERC1155BatchReceived(address , address , uint256[] , uint256[] , bytes ) returns(bytes4) +func (_NegRisk *NegRiskTransactor) OnERC1155BatchReceived(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "onERC1155BatchReceived", arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155BatchReceived is a paid mutator transaction binding the contract method 0xbc197c81. +// +// Solidity: function onERC1155BatchReceived(address , address , uint256[] , uint256[] , bytes ) returns(bytes4) +func (_NegRisk *NegRiskSession) OnERC1155BatchReceived(arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRisk.Contract.OnERC1155BatchReceived(&_NegRisk.TransactOpts, arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155BatchReceived is a paid mutator transaction binding the contract method 0xbc197c81. +// +// Solidity: function onERC1155BatchReceived(address , address , uint256[] , uint256[] , bytes ) returns(bytes4) +func (_NegRisk *NegRiskTransactorSession) OnERC1155BatchReceived(arg0 common.Address, arg1 common.Address, arg2 []*big.Int, arg3 []*big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRisk.Contract.OnERC1155BatchReceived(&_NegRisk.TransactOpts, arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155Received is a paid mutator transaction binding the contract method 0xf23a6e61. +// +// Solidity: function onERC1155Received(address , address , uint256 , uint256 , bytes ) returns(bytes4) +func (_NegRisk *NegRiskTransactor) OnERC1155Received(opts *bind.TransactOpts, arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "onERC1155Received", arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155Received is a paid mutator transaction binding the contract method 0xf23a6e61. +// +// Solidity: function onERC1155Received(address , address , uint256 , uint256 , bytes ) returns(bytes4) +func (_NegRisk *NegRiskSession) OnERC1155Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRisk.Contract.OnERC1155Received(&_NegRisk.TransactOpts, arg0, arg1, arg2, arg3, arg4) +} + +// OnERC1155Received is a paid mutator transaction binding the contract method 0xf23a6e61. +// +// Solidity: function onERC1155Received(address , address , uint256 , uint256 , bytes ) returns(bytes4) +func (_NegRisk *NegRiskTransactorSession) OnERC1155Received(arg0 common.Address, arg1 common.Address, arg2 *big.Int, arg3 *big.Int, arg4 []byte) (*types.Transaction, error) { + return _NegRisk.Contract.OnERC1155Received(&_NegRisk.TransactOpts, arg0, arg1, arg2, arg3, arg4) +} + +// PauseTrading is a paid mutator transaction binding the contract method 0x1031e36e. +// +// Solidity: function pauseTrading() returns() +func (_NegRisk *NegRiskTransactor) PauseTrading(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "pauseTrading") +} + +// PauseTrading is a paid mutator transaction binding the contract method 0x1031e36e. +// +// Solidity: function pauseTrading() returns() +func (_NegRisk *NegRiskSession) PauseTrading() (*types.Transaction, error) { + return _NegRisk.Contract.PauseTrading(&_NegRisk.TransactOpts) +} + +// PauseTrading is a paid mutator transaction binding the contract method 0x1031e36e. +// +// Solidity: function pauseTrading() returns() +func (_NegRisk *NegRiskTransactorSession) PauseTrading() (*types.Transaction, error) { + return _NegRisk.Contract.PauseTrading(&_NegRisk.TransactOpts) +} + +// RegisterToken is a paid mutator transaction binding the contract method 0x68c7450f. +// +// Solidity: function registerToken(uint256 token, uint256 complement, bytes32 conditionId) returns() +func (_NegRisk *NegRiskTransactor) RegisterToken(opts *bind.TransactOpts, token *big.Int, complement *big.Int, conditionId [32]byte) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "registerToken", token, complement, conditionId) +} + +// RegisterToken is a paid mutator transaction binding the contract method 0x68c7450f. +// +// Solidity: function registerToken(uint256 token, uint256 complement, bytes32 conditionId) returns() +func (_NegRisk *NegRiskSession) RegisterToken(token *big.Int, complement *big.Int, conditionId [32]byte) (*types.Transaction, error) { + return _NegRisk.Contract.RegisterToken(&_NegRisk.TransactOpts, token, complement, conditionId) +} + +// RegisterToken is a paid mutator transaction binding the contract method 0x68c7450f. +// +// Solidity: function registerToken(uint256 token, uint256 complement, bytes32 conditionId) returns() +func (_NegRisk *NegRiskTransactorSession) RegisterToken(token *big.Int, complement *big.Int, conditionId [32]byte) (*types.Transaction, error) { + return _NegRisk.Contract.RegisterToken(&_NegRisk.TransactOpts, token, complement, conditionId) +} + +// RemoveAdmin is a paid mutator transaction binding the contract method 0x1785f53c. +// +// Solidity: function removeAdmin(address admin) returns() +func (_NegRisk *NegRiskTransactor) RemoveAdmin(opts *bind.TransactOpts, admin common.Address) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "removeAdmin", admin) +} + +// RemoveAdmin is a paid mutator transaction binding the contract method 0x1785f53c. +// +// Solidity: function removeAdmin(address admin) returns() +func (_NegRisk *NegRiskSession) RemoveAdmin(admin common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.RemoveAdmin(&_NegRisk.TransactOpts, admin) +} + +// RemoveAdmin is a paid mutator transaction binding the contract method 0x1785f53c. +// +// Solidity: function removeAdmin(address admin) returns() +func (_NegRisk *NegRiskTransactorSession) RemoveAdmin(admin common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.RemoveAdmin(&_NegRisk.TransactOpts, admin) +} + +// RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a. +// +// Solidity: function removeOperator(address operator) returns() +func (_NegRisk *NegRiskTransactor) RemoveOperator(opts *bind.TransactOpts, operator common.Address) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "removeOperator", operator) +} + +// RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a. +// +// Solidity: function removeOperator(address operator) returns() +func (_NegRisk *NegRiskSession) RemoveOperator(operator common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.RemoveOperator(&_NegRisk.TransactOpts, operator) +} + +// RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a. +// +// Solidity: function removeOperator(address operator) returns() +func (_NegRisk *NegRiskTransactorSession) RemoveOperator(operator common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.RemoveOperator(&_NegRisk.TransactOpts, operator) +} + +// RenounceAdminRole is a paid mutator transaction binding the contract method 0x83b8a5ae. +// +// Solidity: function renounceAdminRole() returns() +func (_NegRisk *NegRiskTransactor) RenounceAdminRole(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "renounceAdminRole") +} + +// RenounceAdminRole is a paid mutator transaction binding the contract method 0x83b8a5ae. +// +// Solidity: function renounceAdminRole() returns() +func (_NegRisk *NegRiskSession) RenounceAdminRole() (*types.Transaction, error) { + return _NegRisk.Contract.RenounceAdminRole(&_NegRisk.TransactOpts) +} + +// RenounceAdminRole is a paid mutator transaction binding the contract method 0x83b8a5ae. +// +// Solidity: function renounceAdminRole() returns() +func (_NegRisk *NegRiskTransactorSession) RenounceAdminRole() (*types.Transaction, error) { + return _NegRisk.Contract.RenounceAdminRole(&_NegRisk.TransactOpts) +} + +// RenounceOperatorRole is a paid mutator transaction binding the contract method 0x3d6d3598. +// +// Solidity: function renounceOperatorRole() returns() +func (_NegRisk *NegRiskTransactor) RenounceOperatorRole(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "renounceOperatorRole") +} + +// RenounceOperatorRole is a paid mutator transaction binding the contract method 0x3d6d3598. +// +// Solidity: function renounceOperatorRole() returns() +func (_NegRisk *NegRiskSession) RenounceOperatorRole() (*types.Transaction, error) { + return _NegRisk.Contract.RenounceOperatorRole(&_NegRisk.TransactOpts) +} + +// RenounceOperatorRole is a paid mutator transaction binding the contract method 0x3d6d3598. +// +// Solidity: function renounceOperatorRole() returns() +func (_NegRisk *NegRiskTransactorSession) RenounceOperatorRole() (*types.Transaction, error) { + return _NegRisk.Contract.RenounceOperatorRole(&_NegRisk.TransactOpts) +} + +// SetProxyFactory is a paid mutator transaction binding the contract method 0xfbddd751. +// +// Solidity: function setProxyFactory(address _newProxyFactory) returns() +func (_NegRisk *NegRiskTransactor) SetProxyFactory(opts *bind.TransactOpts, _newProxyFactory common.Address) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "setProxyFactory", _newProxyFactory) +} + +// SetProxyFactory is a paid mutator transaction binding the contract method 0xfbddd751. +// +// Solidity: function setProxyFactory(address _newProxyFactory) returns() +func (_NegRisk *NegRiskSession) SetProxyFactory(_newProxyFactory common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.SetProxyFactory(&_NegRisk.TransactOpts, _newProxyFactory) +} + +// SetProxyFactory is a paid mutator transaction binding the contract method 0xfbddd751. +// +// Solidity: function setProxyFactory(address _newProxyFactory) returns() +func (_NegRisk *NegRiskTransactorSession) SetProxyFactory(_newProxyFactory common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.SetProxyFactory(&_NegRisk.TransactOpts, _newProxyFactory) +} + +// SetSafeFactory is a paid mutator transaction binding the contract method 0x4544f055. +// +// Solidity: function setSafeFactory(address _newSafeFactory) returns() +func (_NegRisk *NegRiskTransactor) SetSafeFactory(opts *bind.TransactOpts, _newSafeFactory common.Address) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "setSafeFactory", _newSafeFactory) +} + +// SetSafeFactory is a paid mutator transaction binding the contract method 0x4544f055. +// +// Solidity: function setSafeFactory(address _newSafeFactory) returns() +func (_NegRisk *NegRiskSession) SetSafeFactory(_newSafeFactory common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.SetSafeFactory(&_NegRisk.TransactOpts, _newSafeFactory) +} + +// SetSafeFactory is a paid mutator transaction binding the contract method 0x4544f055. +// +// Solidity: function setSafeFactory(address _newSafeFactory) returns() +func (_NegRisk *NegRiskTransactorSession) SetSafeFactory(_newSafeFactory common.Address) (*types.Transaction, error) { + return _NegRisk.Contract.SetSafeFactory(&_NegRisk.TransactOpts, _newSafeFactory) +} + +// UnpauseTrading is a paid mutator transaction binding the contract method 0x456068d2. +// +// Solidity: function unpauseTrading() returns() +func (_NegRisk *NegRiskTransactor) UnpauseTrading(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NegRisk.contract.Transact(opts, "unpauseTrading") +} + +// UnpauseTrading is a paid mutator transaction binding the contract method 0x456068d2. +// +// Solidity: function unpauseTrading() returns() +func (_NegRisk *NegRiskSession) UnpauseTrading() (*types.Transaction, error) { + return _NegRisk.Contract.UnpauseTrading(&_NegRisk.TransactOpts) +} + +// UnpauseTrading is a paid mutator transaction binding the contract method 0x456068d2. +// +// Solidity: function unpauseTrading() returns() +func (_NegRisk *NegRiskTransactorSession) UnpauseTrading() (*types.Transaction, error) { + return _NegRisk.Contract.UnpauseTrading(&_NegRisk.TransactOpts) +} + +// NegRiskFeeChargedIterator is returned from FilterFeeCharged and is used to iterate over the raw logs and unpacked data for FeeCharged events raised by the NegRisk contract. +type NegRiskFeeChargedIterator struct { + Event *NegRiskFeeCharged // 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 *NegRiskFeeChargedIterator) 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(NegRiskFeeCharged) + 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(NegRiskFeeCharged) + 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 *NegRiskFeeChargedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskFeeChargedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskFeeCharged represents a FeeCharged event raised by the NegRisk contract. +type NegRiskFeeCharged struct { + Receiver common.Address + TokenId *big.Int + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeeCharged is a free log retrieval operation binding the contract event 0xacffcc86834d0f1a64b0d5a675798deed6ff0bcfc2231edd3480e7288dba7ff4. +// +// Solidity: event FeeCharged(address indexed receiver, uint256 tokenId, uint256 amount) +func (_NegRisk *NegRiskFilterer) FilterFeeCharged(opts *bind.FilterOpts, receiver []common.Address) (*NegRiskFeeChargedIterator, error) { + + var receiverRule []interface{} + for _, receiverItem := range receiver { + receiverRule = append(receiverRule, receiverItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "FeeCharged", receiverRule) + if err != nil { + return nil, err + } + return &NegRiskFeeChargedIterator{contract: _NegRisk.contract, event: "FeeCharged", logs: logs, sub: sub}, nil +} + +// WatchFeeCharged is a free log subscription operation binding the contract event 0xacffcc86834d0f1a64b0d5a675798deed6ff0bcfc2231edd3480e7288dba7ff4. +// +// Solidity: event FeeCharged(address indexed receiver, uint256 tokenId, uint256 amount) +func (_NegRisk *NegRiskFilterer) WatchFeeCharged(opts *bind.WatchOpts, sink chan<- *NegRiskFeeCharged, receiver []common.Address) (event.Subscription, error) { + + var receiverRule []interface{} + for _, receiverItem := range receiver { + receiverRule = append(receiverRule, receiverItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "FeeCharged", receiverRule) + 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(NegRiskFeeCharged) + if err := _NegRisk.contract.UnpackLog(event, "FeeCharged", 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 +} + +// ParseFeeCharged is a log parse operation binding the contract event 0xacffcc86834d0f1a64b0d5a675798deed6ff0bcfc2231edd3480e7288dba7ff4. +// +// Solidity: event FeeCharged(address indexed receiver, uint256 tokenId, uint256 amount) +func (_NegRisk *NegRiskFilterer) ParseFeeCharged(log types.Log) (*NegRiskFeeCharged, error) { + event := new(NegRiskFeeCharged) + if err := _NegRisk.contract.UnpackLog(event, "FeeCharged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskNewAdminIterator is returned from FilterNewAdmin and is used to iterate over the raw logs and unpacked data for NewAdmin events raised by the NegRisk contract. +type NegRiskNewAdminIterator struct { + Event *NegRiskNewAdmin // 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 *NegRiskNewAdminIterator) 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(NegRiskNewAdmin) + 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(NegRiskNewAdmin) + 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 *NegRiskNewAdminIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskNewAdminIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskNewAdmin represents a NewAdmin event raised by the NegRisk contract. +type NegRiskNewAdmin struct { + NewAdminAddress common.Address + Admin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewAdmin is a free log retrieval operation binding the contract event 0xf9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc. +// +// Solidity: event NewAdmin(address indexed newAdminAddress, address indexed admin) +func (_NegRisk *NegRiskFilterer) FilterNewAdmin(opts *bind.FilterOpts, newAdminAddress []common.Address, admin []common.Address) (*NegRiskNewAdminIterator, error) { + + var newAdminAddressRule []interface{} + for _, newAdminAddressItem := range newAdminAddress { + newAdminAddressRule = append(newAdminAddressRule, newAdminAddressItem) + } + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "NewAdmin", newAdminAddressRule, adminRule) + if err != nil { + return nil, err + } + return &NegRiskNewAdminIterator{contract: _NegRisk.contract, event: "NewAdmin", logs: logs, sub: sub}, nil +} + +// WatchNewAdmin is a free log subscription operation binding the contract event 0xf9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc. +// +// Solidity: event NewAdmin(address indexed newAdminAddress, address indexed admin) +func (_NegRisk *NegRiskFilterer) WatchNewAdmin(opts *bind.WatchOpts, sink chan<- *NegRiskNewAdmin, newAdminAddress []common.Address, admin []common.Address) (event.Subscription, error) { + + var newAdminAddressRule []interface{} + for _, newAdminAddressItem := range newAdminAddress { + newAdminAddressRule = append(newAdminAddressRule, newAdminAddressItem) + } + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "NewAdmin", newAdminAddressRule, adminRule) + 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(NegRiskNewAdmin) + if err := _NegRisk.contract.UnpackLog(event, "NewAdmin", 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 +} + +// ParseNewAdmin is a log parse operation binding the contract event 0xf9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc. +// +// Solidity: event NewAdmin(address indexed newAdminAddress, address indexed admin) +func (_NegRisk *NegRiskFilterer) ParseNewAdmin(log types.Log) (*NegRiskNewAdmin, error) { + event := new(NegRiskNewAdmin) + if err := _NegRisk.contract.UnpackLog(event, "NewAdmin", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskNewOperatorIterator is returned from FilterNewOperator and is used to iterate over the raw logs and unpacked data for NewOperator events raised by the NegRisk contract. +type NegRiskNewOperatorIterator struct { + Event *NegRiskNewOperator // 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 *NegRiskNewOperatorIterator) 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(NegRiskNewOperator) + 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(NegRiskNewOperator) + 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 *NegRiskNewOperatorIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskNewOperatorIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskNewOperator represents a NewOperator event raised by the NegRisk contract. +type NegRiskNewOperator struct { + NewOperatorAddress common.Address + Admin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewOperator is a free log retrieval operation binding the contract event 0xf1e04d73c4304b5ff164f9d10c7473e2a1593b740674a6107975e2a7001c1e5c. +// +// Solidity: event NewOperator(address indexed newOperatorAddress, address indexed admin) +func (_NegRisk *NegRiskFilterer) FilterNewOperator(opts *bind.FilterOpts, newOperatorAddress []common.Address, admin []common.Address) (*NegRiskNewOperatorIterator, error) { + + var newOperatorAddressRule []interface{} + for _, newOperatorAddressItem := range newOperatorAddress { + newOperatorAddressRule = append(newOperatorAddressRule, newOperatorAddressItem) + } + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "NewOperator", newOperatorAddressRule, adminRule) + if err != nil { + return nil, err + } + return &NegRiskNewOperatorIterator{contract: _NegRisk.contract, event: "NewOperator", logs: logs, sub: sub}, nil +} + +// WatchNewOperator is a free log subscription operation binding the contract event 0xf1e04d73c4304b5ff164f9d10c7473e2a1593b740674a6107975e2a7001c1e5c. +// +// Solidity: event NewOperator(address indexed newOperatorAddress, address indexed admin) +func (_NegRisk *NegRiskFilterer) WatchNewOperator(opts *bind.WatchOpts, sink chan<- *NegRiskNewOperator, newOperatorAddress []common.Address, admin []common.Address) (event.Subscription, error) { + + var newOperatorAddressRule []interface{} + for _, newOperatorAddressItem := range newOperatorAddress { + newOperatorAddressRule = append(newOperatorAddressRule, newOperatorAddressItem) + } + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "NewOperator", newOperatorAddressRule, adminRule) + 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(NegRiskNewOperator) + if err := _NegRisk.contract.UnpackLog(event, "NewOperator", 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 +} + +// ParseNewOperator is a log parse operation binding the contract event 0xf1e04d73c4304b5ff164f9d10c7473e2a1593b740674a6107975e2a7001c1e5c. +// +// Solidity: event NewOperator(address indexed newOperatorAddress, address indexed admin) +func (_NegRisk *NegRiskFilterer) ParseNewOperator(log types.Log) (*NegRiskNewOperator, error) { + event := new(NegRiskNewOperator) + if err := _NegRisk.contract.UnpackLog(event, "NewOperator", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskOrderCancelledIterator is returned from FilterOrderCancelled and is used to iterate over the raw logs and unpacked data for OrderCancelled events raised by the NegRisk contract. +type NegRiskOrderCancelledIterator struct { + Event *NegRiskOrderCancelled // 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 *NegRiskOrderCancelledIterator) 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(NegRiskOrderCancelled) + 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(NegRiskOrderCancelled) + 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 *NegRiskOrderCancelledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskOrderCancelledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskOrderCancelled represents a OrderCancelled event raised by the NegRisk contract. +type NegRiskOrderCancelled struct { + OrderHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOrderCancelled is a free log retrieval operation binding the contract event 0x5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d. +// +// Solidity: event OrderCancelled(bytes32 indexed orderHash) +func (_NegRisk *NegRiskFilterer) FilterOrderCancelled(opts *bind.FilterOpts, orderHash [][32]byte) (*NegRiskOrderCancelledIterator, error) { + + var orderHashRule []interface{} + for _, orderHashItem := range orderHash { + orderHashRule = append(orderHashRule, orderHashItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "OrderCancelled", orderHashRule) + if err != nil { + return nil, err + } + return &NegRiskOrderCancelledIterator{contract: _NegRisk.contract, event: "OrderCancelled", logs: logs, sub: sub}, nil +} + +// WatchOrderCancelled is a free log subscription operation binding the contract event 0x5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d. +// +// Solidity: event OrderCancelled(bytes32 indexed orderHash) +func (_NegRisk *NegRiskFilterer) WatchOrderCancelled(opts *bind.WatchOpts, sink chan<- *NegRiskOrderCancelled, orderHash [][32]byte) (event.Subscription, error) { + + var orderHashRule []interface{} + for _, orderHashItem := range orderHash { + orderHashRule = append(orderHashRule, orderHashItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "OrderCancelled", orderHashRule) + 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(NegRiskOrderCancelled) + if err := _NegRisk.contract.UnpackLog(event, "OrderCancelled", 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 +} + +// ParseOrderCancelled is a log parse operation binding the contract event 0x5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d. +// +// Solidity: event OrderCancelled(bytes32 indexed orderHash) +func (_NegRisk *NegRiskFilterer) ParseOrderCancelled(log types.Log) (*NegRiskOrderCancelled, error) { + event := new(NegRiskOrderCancelled) + if err := _NegRisk.contract.UnpackLog(event, "OrderCancelled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskOrderFilledIterator is returned from FilterOrderFilled and is used to iterate over the raw logs and unpacked data for OrderFilled events raised by the NegRisk contract. +type NegRiskOrderFilledIterator struct { + Event *NegRiskOrderFilled // 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 *NegRiskOrderFilledIterator) 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(NegRiskOrderFilled) + 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(NegRiskOrderFilled) + 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 *NegRiskOrderFilledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskOrderFilledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskOrderFilled represents a OrderFilled event raised by the NegRisk contract. +type NegRiskOrderFilled struct { + OrderHash [32]byte + Maker common.Address + Taker common.Address + MakerAssetId *big.Int + TakerAssetId *big.Int + MakerAmountFilled *big.Int + TakerAmountFilled *big.Int + Fee *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOrderFilled is a free log retrieval operation binding the contract event 0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6. +// +// Solidity: event OrderFilled(bytes32 indexed orderHash, address indexed maker, address indexed taker, uint256 makerAssetId, uint256 takerAssetId, uint256 makerAmountFilled, uint256 takerAmountFilled, uint256 fee) +func (_NegRisk *NegRiskFilterer) FilterOrderFilled(opts *bind.FilterOpts, orderHash [][32]byte, maker []common.Address, taker []common.Address) (*NegRiskOrderFilledIterator, error) { + + var orderHashRule []interface{} + for _, orderHashItem := range orderHash { + orderHashRule = append(orderHashRule, orderHashItem) + } + var makerRule []interface{} + for _, makerItem := range maker { + makerRule = append(makerRule, makerItem) + } + var takerRule []interface{} + for _, takerItem := range taker { + takerRule = append(takerRule, takerItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "OrderFilled", orderHashRule, makerRule, takerRule) + if err != nil { + return nil, err + } + return &NegRiskOrderFilledIterator{contract: _NegRisk.contract, event: "OrderFilled", logs: logs, sub: sub}, nil +} + +// WatchOrderFilled is a free log subscription operation binding the contract event 0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6. +// +// Solidity: event OrderFilled(bytes32 indexed orderHash, address indexed maker, address indexed taker, uint256 makerAssetId, uint256 takerAssetId, uint256 makerAmountFilled, uint256 takerAmountFilled, uint256 fee) +func (_NegRisk *NegRiskFilterer) WatchOrderFilled(opts *bind.WatchOpts, sink chan<- *NegRiskOrderFilled, orderHash [][32]byte, maker []common.Address, taker []common.Address) (event.Subscription, error) { + + var orderHashRule []interface{} + for _, orderHashItem := range orderHash { + orderHashRule = append(orderHashRule, orderHashItem) + } + var makerRule []interface{} + for _, makerItem := range maker { + makerRule = append(makerRule, makerItem) + } + var takerRule []interface{} + for _, takerItem := range taker { + takerRule = append(takerRule, takerItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "OrderFilled", orderHashRule, makerRule, takerRule) + 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(NegRiskOrderFilled) + if err := _NegRisk.contract.UnpackLog(event, "OrderFilled", 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 +} + +// ParseOrderFilled is a log parse operation binding the contract event 0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6. +// +// Solidity: event OrderFilled(bytes32 indexed orderHash, address indexed maker, address indexed taker, uint256 makerAssetId, uint256 takerAssetId, uint256 makerAmountFilled, uint256 takerAmountFilled, uint256 fee) +func (_NegRisk *NegRiskFilterer) ParseOrderFilled(log types.Log) (*NegRiskOrderFilled, error) { + event := new(NegRiskOrderFilled) + if err := _NegRisk.contract.UnpackLog(event, "OrderFilled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskOrdersMatchedIterator is returned from FilterOrdersMatched and is used to iterate over the raw logs and unpacked data for OrdersMatched events raised by the NegRisk contract. +type NegRiskOrdersMatchedIterator struct { + Event *NegRiskOrdersMatched // 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 *NegRiskOrdersMatchedIterator) 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(NegRiskOrdersMatched) + 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(NegRiskOrdersMatched) + 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 *NegRiskOrdersMatchedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskOrdersMatchedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskOrdersMatched represents a OrdersMatched event raised by the NegRisk contract. +type NegRiskOrdersMatched struct { + TakerOrderHash [32]byte + TakerOrderMaker common.Address + MakerAssetId *big.Int + TakerAssetId *big.Int + MakerAmountFilled *big.Int + TakerAmountFilled *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOrdersMatched is a free log retrieval operation binding the contract event 0x63bf4d16b7fa898ef4c4b2b6d90fd201e9c56313b65638af6088d149d2ce956c. +// +// Solidity: event OrdersMatched(bytes32 indexed takerOrderHash, address indexed takerOrderMaker, uint256 makerAssetId, uint256 takerAssetId, uint256 makerAmountFilled, uint256 takerAmountFilled) +func (_NegRisk *NegRiskFilterer) FilterOrdersMatched(opts *bind.FilterOpts, takerOrderHash [][32]byte, takerOrderMaker []common.Address) (*NegRiskOrdersMatchedIterator, error) { + + var takerOrderHashRule []interface{} + for _, takerOrderHashItem := range takerOrderHash { + takerOrderHashRule = append(takerOrderHashRule, takerOrderHashItem) + } + var takerOrderMakerRule []interface{} + for _, takerOrderMakerItem := range takerOrderMaker { + takerOrderMakerRule = append(takerOrderMakerRule, takerOrderMakerItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "OrdersMatched", takerOrderHashRule, takerOrderMakerRule) + if err != nil { + return nil, err + } + return &NegRiskOrdersMatchedIterator{contract: _NegRisk.contract, event: "OrdersMatched", logs: logs, sub: sub}, nil +} + +// WatchOrdersMatched is a free log subscription operation binding the contract event 0x63bf4d16b7fa898ef4c4b2b6d90fd201e9c56313b65638af6088d149d2ce956c. +// +// Solidity: event OrdersMatched(bytes32 indexed takerOrderHash, address indexed takerOrderMaker, uint256 makerAssetId, uint256 takerAssetId, uint256 makerAmountFilled, uint256 takerAmountFilled) +func (_NegRisk *NegRiskFilterer) WatchOrdersMatched(opts *bind.WatchOpts, sink chan<- *NegRiskOrdersMatched, takerOrderHash [][32]byte, takerOrderMaker []common.Address) (event.Subscription, error) { + + var takerOrderHashRule []interface{} + for _, takerOrderHashItem := range takerOrderHash { + takerOrderHashRule = append(takerOrderHashRule, takerOrderHashItem) + } + var takerOrderMakerRule []interface{} + for _, takerOrderMakerItem := range takerOrderMaker { + takerOrderMakerRule = append(takerOrderMakerRule, takerOrderMakerItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "OrdersMatched", takerOrderHashRule, takerOrderMakerRule) + 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(NegRiskOrdersMatched) + if err := _NegRisk.contract.UnpackLog(event, "OrdersMatched", 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 +} + +// ParseOrdersMatched is a log parse operation binding the contract event 0x63bf4d16b7fa898ef4c4b2b6d90fd201e9c56313b65638af6088d149d2ce956c. +// +// Solidity: event OrdersMatched(bytes32 indexed takerOrderHash, address indexed takerOrderMaker, uint256 makerAssetId, uint256 takerAssetId, uint256 makerAmountFilled, uint256 takerAmountFilled) +func (_NegRisk *NegRiskFilterer) ParseOrdersMatched(log types.Log) (*NegRiskOrdersMatched, error) { + event := new(NegRiskOrdersMatched) + if err := _NegRisk.contract.UnpackLog(event, "OrdersMatched", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskProxyFactoryUpdatedIterator is returned from FilterProxyFactoryUpdated and is used to iterate over the raw logs and unpacked data for ProxyFactoryUpdated events raised by the NegRisk contract. +type NegRiskProxyFactoryUpdatedIterator struct { + Event *NegRiskProxyFactoryUpdated // 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 *NegRiskProxyFactoryUpdatedIterator) 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(NegRiskProxyFactoryUpdated) + 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(NegRiskProxyFactoryUpdated) + 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 *NegRiskProxyFactoryUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskProxyFactoryUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskProxyFactoryUpdated represents a ProxyFactoryUpdated event raised by the NegRisk contract. +type NegRiskProxyFactoryUpdated struct { + OldProxyFactory common.Address + NewProxyFactory common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterProxyFactoryUpdated is a free log retrieval operation binding the contract event 0x3053c6252a932554235c173caffc1913604dba3a41cee89516f631c4a1a50a37. +// +// Solidity: event ProxyFactoryUpdated(address indexed oldProxyFactory, address indexed newProxyFactory) +func (_NegRisk *NegRiskFilterer) FilterProxyFactoryUpdated(opts *bind.FilterOpts, oldProxyFactory []common.Address, newProxyFactory []common.Address) (*NegRiskProxyFactoryUpdatedIterator, error) { + + var oldProxyFactoryRule []interface{} + for _, oldProxyFactoryItem := range oldProxyFactory { + oldProxyFactoryRule = append(oldProxyFactoryRule, oldProxyFactoryItem) + } + var newProxyFactoryRule []interface{} + for _, newProxyFactoryItem := range newProxyFactory { + newProxyFactoryRule = append(newProxyFactoryRule, newProxyFactoryItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "ProxyFactoryUpdated", oldProxyFactoryRule, newProxyFactoryRule) + if err != nil { + return nil, err + } + return &NegRiskProxyFactoryUpdatedIterator{contract: _NegRisk.contract, event: "ProxyFactoryUpdated", logs: logs, sub: sub}, nil +} + +// WatchProxyFactoryUpdated is a free log subscription operation binding the contract event 0x3053c6252a932554235c173caffc1913604dba3a41cee89516f631c4a1a50a37. +// +// Solidity: event ProxyFactoryUpdated(address indexed oldProxyFactory, address indexed newProxyFactory) +func (_NegRisk *NegRiskFilterer) WatchProxyFactoryUpdated(opts *bind.WatchOpts, sink chan<- *NegRiskProxyFactoryUpdated, oldProxyFactory []common.Address, newProxyFactory []common.Address) (event.Subscription, error) { + + var oldProxyFactoryRule []interface{} + for _, oldProxyFactoryItem := range oldProxyFactory { + oldProxyFactoryRule = append(oldProxyFactoryRule, oldProxyFactoryItem) + } + var newProxyFactoryRule []interface{} + for _, newProxyFactoryItem := range newProxyFactory { + newProxyFactoryRule = append(newProxyFactoryRule, newProxyFactoryItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "ProxyFactoryUpdated", oldProxyFactoryRule, newProxyFactoryRule) + 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(NegRiskProxyFactoryUpdated) + if err := _NegRisk.contract.UnpackLog(event, "ProxyFactoryUpdated", 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 +} + +// ParseProxyFactoryUpdated is a log parse operation binding the contract event 0x3053c6252a932554235c173caffc1913604dba3a41cee89516f631c4a1a50a37. +// +// Solidity: event ProxyFactoryUpdated(address indexed oldProxyFactory, address indexed newProxyFactory) +func (_NegRisk *NegRiskFilterer) ParseProxyFactoryUpdated(log types.Log) (*NegRiskProxyFactoryUpdated, error) { + event := new(NegRiskProxyFactoryUpdated) + if err := _NegRisk.contract.UnpackLog(event, "ProxyFactoryUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskRemovedAdminIterator is returned from FilterRemovedAdmin and is used to iterate over the raw logs and unpacked data for RemovedAdmin events raised by the NegRisk contract. +type NegRiskRemovedAdminIterator struct { + Event *NegRiskRemovedAdmin // 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 *NegRiskRemovedAdminIterator) 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(NegRiskRemovedAdmin) + 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(NegRiskRemovedAdmin) + 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 *NegRiskRemovedAdminIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskRemovedAdminIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskRemovedAdmin represents a RemovedAdmin event raised by the NegRisk contract. +type NegRiskRemovedAdmin struct { + RemovedAdmin common.Address + Admin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemovedAdmin is a free log retrieval operation binding the contract event 0x787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e. +// +// Solidity: event RemovedAdmin(address indexed removedAdmin, address indexed admin) +func (_NegRisk *NegRiskFilterer) FilterRemovedAdmin(opts *bind.FilterOpts, removedAdmin []common.Address, admin []common.Address) (*NegRiskRemovedAdminIterator, error) { + + var removedAdminRule []interface{} + for _, removedAdminItem := range removedAdmin { + removedAdminRule = append(removedAdminRule, removedAdminItem) + } + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "RemovedAdmin", removedAdminRule, adminRule) + if err != nil { + return nil, err + } + return &NegRiskRemovedAdminIterator{contract: _NegRisk.contract, event: "RemovedAdmin", logs: logs, sub: sub}, nil +} + +// WatchRemovedAdmin is a free log subscription operation binding the contract event 0x787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e. +// +// Solidity: event RemovedAdmin(address indexed removedAdmin, address indexed admin) +func (_NegRisk *NegRiskFilterer) WatchRemovedAdmin(opts *bind.WatchOpts, sink chan<- *NegRiskRemovedAdmin, removedAdmin []common.Address, admin []common.Address) (event.Subscription, error) { + + var removedAdminRule []interface{} + for _, removedAdminItem := range removedAdmin { + removedAdminRule = append(removedAdminRule, removedAdminItem) + } + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "RemovedAdmin", removedAdminRule, adminRule) + 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(NegRiskRemovedAdmin) + if err := _NegRisk.contract.UnpackLog(event, "RemovedAdmin", 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 +} + +// ParseRemovedAdmin is a log parse operation binding the contract event 0x787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e. +// +// Solidity: event RemovedAdmin(address indexed removedAdmin, address indexed admin) +func (_NegRisk *NegRiskFilterer) ParseRemovedAdmin(log types.Log) (*NegRiskRemovedAdmin, error) { + event := new(NegRiskRemovedAdmin) + if err := _NegRisk.contract.UnpackLog(event, "RemovedAdmin", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskRemovedOperatorIterator is returned from FilterRemovedOperator and is used to iterate over the raw logs and unpacked data for RemovedOperator events raised by the NegRisk contract. +type NegRiskRemovedOperatorIterator struct { + Event *NegRiskRemovedOperator // 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 *NegRiskRemovedOperatorIterator) 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(NegRiskRemovedOperator) + 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(NegRiskRemovedOperator) + 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 *NegRiskRemovedOperatorIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskRemovedOperatorIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskRemovedOperator represents a RemovedOperator event raised by the NegRisk contract. +type NegRiskRemovedOperator struct { + RemovedOperator common.Address + Admin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemovedOperator is a free log retrieval operation binding the contract event 0xf7262ed0443cc211121ceb1a80d69004f319245615a7488f951f1437fd91642c. +// +// Solidity: event RemovedOperator(address indexed removedOperator, address indexed admin) +func (_NegRisk *NegRiskFilterer) FilterRemovedOperator(opts *bind.FilterOpts, removedOperator []common.Address, admin []common.Address) (*NegRiskRemovedOperatorIterator, error) { + + var removedOperatorRule []interface{} + for _, removedOperatorItem := range removedOperator { + removedOperatorRule = append(removedOperatorRule, removedOperatorItem) + } + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "RemovedOperator", removedOperatorRule, adminRule) + if err != nil { + return nil, err + } + return &NegRiskRemovedOperatorIterator{contract: _NegRisk.contract, event: "RemovedOperator", logs: logs, sub: sub}, nil +} + +// WatchRemovedOperator is a free log subscription operation binding the contract event 0xf7262ed0443cc211121ceb1a80d69004f319245615a7488f951f1437fd91642c. +// +// Solidity: event RemovedOperator(address indexed removedOperator, address indexed admin) +func (_NegRisk *NegRiskFilterer) WatchRemovedOperator(opts *bind.WatchOpts, sink chan<- *NegRiskRemovedOperator, removedOperator []common.Address, admin []common.Address) (event.Subscription, error) { + + var removedOperatorRule []interface{} + for _, removedOperatorItem := range removedOperator { + removedOperatorRule = append(removedOperatorRule, removedOperatorItem) + } + var adminRule []interface{} + for _, adminItem := range admin { + adminRule = append(adminRule, adminItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "RemovedOperator", removedOperatorRule, adminRule) + 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(NegRiskRemovedOperator) + if err := _NegRisk.contract.UnpackLog(event, "RemovedOperator", 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 +} + +// ParseRemovedOperator is a log parse operation binding the contract event 0xf7262ed0443cc211121ceb1a80d69004f319245615a7488f951f1437fd91642c. +// +// Solidity: event RemovedOperator(address indexed removedOperator, address indexed admin) +func (_NegRisk *NegRiskFilterer) ParseRemovedOperator(log types.Log) (*NegRiskRemovedOperator, error) { + event := new(NegRiskRemovedOperator) + if err := _NegRisk.contract.UnpackLog(event, "RemovedOperator", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskSafeFactoryUpdatedIterator is returned from FilterSafeFactoryUpdated and is used to iterate over the raw logs and unpacked data for SafeFactoryUpdated events raised by the NegRisk contract. +type NegRiskSafeFactoryUpdatedIterator struct { + Event *NegRiskSafeFactoryUpdated // 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 *NegRiskSafeFactoryUpdatedIterator) 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(NegRiskSafeFactoryUpdated) + 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(NegRiskSafeFactoryUpdated) + 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 *NegRiskSafeFactoryUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskSafeFactoryUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskSafeFactoryUpdated represents a SafeFactoryUpdated event raised by the NegRisk contract. +type NegRiskSafeFactoryUpdated struct { + OldSafeFactory common.Address + NewSafeFactory common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSafeFactoryUpdated is a free log retrieval operation binding the contract event 0x9726d7faf7429d6b059560dc858ed769377ccdf8b7541eabe12b22548719831f. +// +// Solidity: event SafeFactoryUpdated(address indexed oldSafeFactory, address indexed newSafeFactory) +func (_NegRisk *NegRiskFilterer) FilterSafeFactoryUpdated(opts *bind.FilterOpts, oldSafeFactory []common.Address, newSafeFactory []common.Address) (*NegRiskSafeFactoryUpdatedIterator, error) { + + var oldSafeFactoryRule []interface{} + for _, oldSafeFactoryItem := range oldSafeFactory { + oldSafeFactoryRule = append(oldSafeFactoryRule, oldSafeFactoryItem) + } + var newSafeFactoryRule []interface{} + for _, newSafeFactoryItem := range newSafeFactory { + newSafeFactoryRule = append(newSafeFactoryRule, newSafeFactoryItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "SafeFactoryUpdated", oldSafeFactoryRule, newSafeFactoryRule) + if err != nil { + return nil, err + } + return &NegRiskSafeFactoryUpdatedIterator{contract: _NegRisk.contract, event: "SafeFactoryUpdated", logs: logs, sub: sub}, nil +} + +// WatchSafeFactoryUpdated is a free log subscription operation binding the contract event 0x9726d7faf7429d6b059560dc858ed769377ccdf8b7541eabe12b22548719831f. +// +// Solidity: event SafeFactoryUpdated(address indexed oldSafeFactory, address indexed newSafeFactory) +func (_NegRisk *NegRiskFilterer) WatchSafeFactoryUpdated(opts *bind.WatchOpts, sink chan<- *NegRiskSafeFactoryUpdated, oldSafeFactory []common.Address, newSafeFactory []common.Address) (event.Subscription, error) { + + var oldSafeFactoryRule []interface{} + for _, oldSafeFactoryItem := range oldSafeFactory { + oldSafeFactoryRule = append(oldSafeFactoryRule, oldSafeFactoryItem) + } + var newSafeFactoryRule []interface{} + for _, newSafeFactoryItem := range newSafeFactory { + newSafeFactoryRule = append(newSafeFactoryRule, newSafeFactoryItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "SafeFactoryUpdated", oldSafeFactoryRule, newSafeFactoryRule) + 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(NegRiskSafeFactoryUpdated) + if err := _NegRisk.contract.UnpackLog(event, "SafeFactoryUpdated", 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 +} + +// ParseSafeFactoryUpdated is a log parse operation binding the contract event 0x9726d7faf7429d6b059560dc858ed769377ccdf8b7541eabe12b22548719831f. +// +// Solidity: event SafeFactoryUpdated(address indexed oldSafeFactory, address indexed newSafeFactory) +func (_NegRisk *NegRiskFilterer) ParseSafeFactoryUpdated(log types.Log) (*NegRiskSafeFactoryUpdated, error) { + event := new(NegRiskSafeFactoryUpdated) + if err := _NegRisk.contract.UnpackLog(event, "SafeFactoryUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskTokenRegisteredIterator is returned from FilterTokenRegistered and is used to iterate over the raw logs and unpacked data for TokenRegistered events raised by the NegRisk contract. +type NegRiskTokenRegisteredIterator struct { + Event *NegRiskTokenRegistered // 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 *NegRiskTokenRegisteredIterator) 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(NegRiskTokenRegistered) + 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(NegRiskTokenRegistered) + 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 *NegRiskTokenRegisteredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskTokenRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskTokenRegistered represents a TokenRegistered event raised by the NegRisk contract. +type NegRiskTokenRegistered struct { + Token0 *big.Int + Token1 *big.Int + ConditionId [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTokenRegistered is a free log retrieval operation binding the contract event 0xbc9a2432e8aeb48327246cddd6e872ef452812b4243c04e6bfb786a2cd8faf0d. +// +// Solidity: event TokenRegistered(uint256 indexed token0, uint256 indexed token1, bytes32 indexed conditionId) +func (_NegRisk *NegRiskFilterer) FilterTokenRegistered(opts *bind.FilterOpts, token0 []*big.Int, token1 []*big.Int, conditionId [][32]byte) (*NegRiskTokenRegisteredIterator, error) { + + var token0Rule []interface{} + for _, token0Item := range token0 { + token0Rule = append(token0Rule, token0Item) + } + var token1Rule []interface{} + for _, token1Item := range token1 { + token1Rule = append(token1Rule, token1Item) + } + var conditionIdRule []interface{} + for _, conditionIdItem := range conditionId { + conditionIdRule = append(conditionIdRule, conditionIdItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "TokenRegistered", token0Rule, token1Rule, conditionIdRule) + if err != nil { + return nil, err + } + return &NegRiskTokenRegisteredIterator{contract: _NegRisk.contract, event: "TokenRegistered", logs: logs, sub: sub}, nil +} + +// WatchTokenRegistered is a free log subscription operation binding the contract event 0xbc9a2432e8aeb48327246cddd6e872ef452812b4243c04e6bfb786a2cd8faf0d. +// +// Solidity: event TokenRegistered(uint256 indexed token0, uint256 indexed token1, bytes32 indexed conditionId) +func (_NegRisk *NegRiskFilterer) WatchTokenRegistered(opts *bind.WatchOpts, sink chan<- *NegRiskTokenRegistered, token0 []*big.Int, token1 []*big.Int, conditionId [][32]byte) (event.Subscription, error) { + + var token0Rule []interface{} + for _, token0Item := range token0 { + token0Rule = append(token0Rule, token0Item) + } + var token1Rule []interface{} + for _, token1Item := range token1 { + token1Rule = append(token1Rule, token1Item) + } + var conditionIdRule []interface{} + for _, conditionIdItem := range conditionId { + conditionIdRule = append(conditionIdRule, conditionIdItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "TokenRegistered", token0Rule, token1Rule, conditionIdRule) + 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(NegRiskTokenRegistered) + if err := _NegRisk.contract.UnpackLog(event, "TokenRegistered", 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 +} + +// ParseTokenRegistered is a log parse operation binding the contract event 0xbc9a2432e8aeb48327246cddd6e872ef452812b4243c04e6bfb786a2cd8faf0d. +// +// Solidity: event TokenRegistered(uint256 indexed token0, uint256 indexed token1, bytes32 indexed conditionId) +func (_NegRisk *NegRiskFilterer) ParseTokenRegistered(log types.Log) (*NegRiskTokenRegistered, error) { + event := new(NegRiskTokenRegistered) + if err := _NegRisk.contract.UnpackLog(event, "TokenRegistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskTradingPausedIterator is returned from FilterTradingPaused and is used to iterate over the raw logs and unpacked data for TradingPaused events raised by the NegRisk contract. +type NegRiskTradingPausedIterator struct { + Event *NegRiskTradingPaused // 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 *NegRiskTradingPausedIterator) 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(NegRiskTradingPaused) + 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(NegRiskTradingPaused) + 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 *NegRiskTradingPausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskTradingPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskTradingPaused represents a TradingPaused event raised by the NegRisk contract. +type NegRiskTradingPaused struct { + Pauser common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTradingPaused is a free log retrieval operation binding the contract event 0x203c4bd3e526634f661575359ff30de3b0edaba6c2cb1eac60f730b6d2d9d536. +// +// Solidity: event TradingPaused(address indexed pauser) +func (_NegRisk *NegRiskFilterer) FilterTradingPaused(opts *bind.FilterOpts, pauser []common.Address) (*NegRiskTradingPausedIterator, error) { + + var pauserRule []interface{} + for _, pauserItem := range pauser { + pauserRule = append(pauserRule, pauserItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "TradingPaused", pauserRule) + if err != nil { + return nil, err + } + return &NegRiskTradingPausedIterator{contract: _NegRisk.contract, event: "TradingPaused", logs: logs, sub: sub}, nil +} + +// WatchTradingPaused is a free log subscription operation binding the contract event 0x203c4bd3e526634f661575359ff30de3b0edaba6c2cb1eac60f730b6d2d9d536. +// +// Solidity: event TradingPaused(address indexed pauser) +func (_NegRisk *NegRiskFilterer) WatchTradingPaused(opts *bind.WatchOpts, sink chan<- *NegRiskTradingPaused, pauser []common.Address) (event.Subscription, error) { + + var pauserRule []interface{} + for _, pauserItem := range pauser { + pauserRule = append(pauserRule, pauserItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "TradingPaused", pauserRule) + 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(NegRiskTradingPaused) + if err := _NegRisk.contract.UnpackLog(event, "TradingPaused", 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 +} + +// ParseTradingPaused is a log parse operation binding the contract event 0x203c4bd3e526634f661575359ff30de3b0edaba6c2cb1eac60f730b6d2d9d536. +// +// Solidity: event TradingPaused(address indexed pauser) +func (_NegRisk *NegRiskFilterer) ParseTradingPaused(log types.Log) (*NegRiskTradingPaused, error) { + event := new(NegRiskTradingPaused) + if err := _NegRisk.contract.UnpackLog(event, "TradingPaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NegRiskTradingUnpausedIterator is returned from FilterTradingUnpaused and is used to iterate over the raw logs and unpacked data for TradingUnpaused events raised by the NegRisk contract. +type NegRiskTradingUnpausedIterator struct { + Event *NegRiskTradingUnpaused // 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 *NegRiskTradingUnpausedIterator) 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(NegRiskTradingUnpaused) + 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(NegRiskTradingUnpaused) + 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 *NegRiskTradingUnpausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NegRiskTradingUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NegRiskTradingUnpaused represents a TradingUnpaused event raised by the NegRisk contract. +type NegRiskTradingUnpaused struct { + Pauser common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTradingUnpaused is a free log retrieval operation binding the contract event 0xa1e8a54850dbd7f520bcc09f47bff152294b77b2081da545a7adf531b7ea283b. +// +// Solidity: event TradingUnpaused(address indexed pauser) +func (_NegRisk *NegRiskFilterer) FilterTradingUnpaused(opts *bind.FilterOpts, pauser []common.Address) (*NegRiskTradingUnpausedIterator, error) { + + var pauserRule []interface{} + for _, pauserItem := range pauser { + pauserRule = append(pauserRule, pauserItem) + } + + logs, sub, err := _NegRisk.contract.FilterLogs(opts, "TradingUnpaused", pauserRule) + if err != nil { + return nil, err + } + return &NegRiskTradingUnpausedIterator{contract: _NegRisk.contract, event: "TradingUnpaused", logs: logs, sub: sub}, nil +} + +// WatchTradingUnpaused is a free log subscription operation binding the contract event 0xa1e8a54850dbd7f520bcc09f47bff152294b77b2081da545a7adf531b7ea283b. +// +// Solidity: event TradingUnpaused(address indexed pauser) +func (_NegRisk *NegRiskFilterer) WatchTradingUnpaused(opts *bind.WatchOpts, sink chan<- *NegRiskTradingUnpaused, pauser []common.Address) (event.Subscription, error) { + + var pauserRule []interface{} + for _, pauserItem := range pauser { + pauserRule = append(pauserRule, pauserItem) + } + + logs, sub, err := _NegRisk.contract.WatchLogs(opts, "TradingUnpaused", pauserRule) + 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(NegRiskTradingUnpaused) + if err := _NegRisk.contract.UnpackLog(event, "TradingUnpaused", 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 +} + +// ParseTradingUnpaused is a log parse operation binding the contract event 0xa1e8a54850dbd7f520bcc09f47bff152294b77b2081da545a7adf531b7ea283b. +// +// Solidity: event TradingUnpaused(address indexed pauser) +func (_NegRisk *NegRiskFilterer) ParseTradingUnpaused(log types.Log) (*NegRiskTradingUnpaused, error) { + event := new(NegRiskTradingUnpaused) + if err := _NegRisk.contract.UnpackLog(event, "TradingUnpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/pkg/model/module.go b/pkg/model/module.go new file mode 100644 index 0000000..0e2dc88 --- /dev/null +++ b/pkg/model/module.go @@ -0,0 +1,8 @@ +package model + +type VerifyingContract = int + +const ( + CTFExchange VerifyingContract = iota + NegRiskCTFExchange +) diff --git a/pkg/utils/module.go b/pkg/utils/module.go new file mode 100644 index 0000000..c09263f --- /dev/null +++ b/pkg/utils/module.go @@ -0,0 +1,26 @@ +package utils + +import ( + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/polymarket/go-order-utils/pkg/config" + "github.com/polymarket/go-order-utils/pkg/model" +) + +func GetVerifyingContractAddress(chainId *big.Int, contract model.VerifyingContract) (common.Address, error) { + contracts, err := config.GetContracts(chainId.Int64()) + if err != nil { + return common.Address{}, err + } + + switch contract { + case model.CTFExchange: + return contracts.Exchange, nil + case model.NegRiskCTFExchange: + return contracts.NegRiskExchange, nil + } + + return common.Address{}, fmt.Errorf("invalid contract") +} diff --git a/pkg/utils/module_test.go b/pkg/utils/module_test.go new file mode 100644 index 0000000..24448ed --- /dev/null +++ b/pkg/utils/module_test.go @@ -0,0 +1,37 @@ +package utils + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/polymarket/go-order-utils/pkg/model" + "github.com/stretchr/testify/assert" +) + +func TestGetVerifyingContractAddress(t *testing.T) { + // mumbai + contract, err := GetVerifyingContractAddress(big.NewInt(80001), model.CTFExchange) + assert.NoError(t, err) + assert.Equal(t, common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E").Hex(), contract.Hex()) + + contract, err = GetVerifyingContractAddress(big.NewInt(80001), model.NegRiskCTFExchange) + assert.NoError(t, err) + assert.Equal(t, common.HexToAddress("0x87d1A0DdB4C63a6301916F02090A51a7241571e4").Hex(), contract.Hex()) + + // polygon mainnet + contract, err = GetVerifyingContractAddress(big.NewInt(137), model.CTFExchange) + assert.NoError(t, err) + assert.Equal(t, common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E").Hex(), contract.Hex()) + + contract, err = GetVerifyingContractAddress(big.NewInt(137), model.NegRiskCTFExchange) + assert.NoError(t, err) + assert.Equal(t, common.HexToAddress("0xC5d563A36AE78145C45a50134d48A1215220f80a").Hex(), contract.Hex()) + + // wrong network + _, err = GetVerifyingContractAddress(big.NewInt(1), model.CTFExchange) + assert.Error(t, err) + + _, err = GetVerifyingContractAddress(big.NewInt(1), model.NegRiskCTFExchange) + assert.Error(t, err) +}