Skip to content

Commit

Permalink
local protect button update
Browse files Browse the repository at this point in the history
  • Loading branch information
TymKh committed Sep 28, 2023
1 parent 7d4ab1d commit 4338ff5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ node_modules

.env
.vercel
.env*.local
.env*.local

.idea/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"docusaurus-plugin-sass": "0.2.1",
"docusaurus2-dotenv": "^1.4.0",
"dotenv": "^8.2.0",
"protect-button": "^0.4.2",
"protect-button": "../protect-button/protect",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rehype-katex": "^4.0.0",
Expand Down
9 changes: 9 additions & 0 deletions src/components/ProtectButtonSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ProtectButtonSelector = () => {
const [selectedBuilders, setSelectedBuilders] = useState<string[]>([])
const [calldata, setCalldata] = useState(false)
const [logs, setLogs] = useState(false)
const [defaultLogs, setDefaultLogs] = useState(false)
const [contractAddress, setContractAddress] = useState(false)
const [functionSelector, setFunctionSelector] = useState(false)
const [noHints, setNoHints] = useState(false)
Expand All @@ -22,6 +23,7 @@ const ProtectButtonSelector = () => {
const hints = advancedOptionsShown ? {
calldata,
logs,
defaultLogs,
contractAddress,
functionSelector,
hash: true,
Expand All @@ -33,6 +35,7 @@ const ProtectButtonSelector = () => {
// We have to also clear all of the other hints if someone selects no hints.
setCalldata(false);
setLogs(false);
setDefaultLogs(false);
setContractAddress(false);
setFunctionSelector(false);
}
Expand All @@ -51,6 +54,11 @@ const ProtectButtonSelector = () => {
setLogs(val);
}

const onSetDefaultLogs = (val: boolean) => {
setNoHints(false);
setDefaultLogs(val);
}

const onSetFunctionSelector = (val: boolean) => {
setNoHints(false);
setFunctionSelector(val);
Expand Down Expand Up @@ -122,6 +130,7 @@ const ProtectButtonSelector = () => {
<Checkbox label='Contract Address' id='contractAddress' checked={contractAddress} onChange={onSetContractAddress} />
<Checkbox label='Function Selector' id='functionSelector' checked={functionSelector} onChange={onSetFunctionSelector} />
<Checkbox label='Logs' id='logs' checked={logs} onChange={onSetLogs} />
<Checkbox label='DefaultLogs' id='defaultLogs' checked={defaultLogs} onChange={onSetDefaultLogs} />
<Checkbox label='None' id='none' checked={noHints} onChange={onSetNoHints} />
<div style={{ width: 64 }} /> {/* spacer */}
</AlignItems>
Expand Down
34 changes: 31 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,13 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.48.0.tgz#642633964e217905436033a2bd08bf322849b7fb"
integrity sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==

"@flashbots/mev-share-client@file:../mev-share-client-ts":
version "0.7.6"
dependencies:
async-mutex "^0.4.0"
axios "^1.3.4"
eventsource "^2.0.2"

"@hapi/hoek@^9.0.0":
version "9.3.0"
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb"
Expand Down Expand Up @@ -2813,6 +2820,13 @@ asap@~2.0.3:
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==

async-mutex@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.4.0.tgz#ae8048cd4d04ace94347507504b3cf15e631c25f"
integrity sha512-eJFZ1YhRR8UN8eBLoNzcDPcy/jqjsg6I1AP+KvWQX80BqOSW1oJPJXDylPUEeMr2ZQvHgnQ//Lp6f3RQ1zI7HA==
dependencies:
tslib "^2.4.0"

asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
Expand Down Expand Up @@ -2842,6 +2856,15 @@ axios@^0.25.0:
dependencies:
follow-redirects "^1.14.7"

axios@^1.3.4:
version "1.5.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.5.1.tgz#11fbaa11fc35f431193a9564109c88c1f27b585f"
integrity sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==
dependencies:
follow-redirects "^1.15.0"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axios@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.5.0.tgz#f02e4af823e2e46a9768cfc74691fdd0517ea267"
Expand Down Expand Up @@ -4318,6 +4341,11 @@ events@^3.2.0:
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==

eventsource@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-2.0.2.tgz#76dfcc02930fb2ff339520b6d290da573a9e8508"
integrity sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==

execa@^5.0.0:
version "5.1.1"
resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd"
Expand Down Expand Up @@ -7386,10 +7414,10 @@ property-information@^5.0.0, property-information@^5.3.0:
dependencies:
xtend "^4.0.0"

protect-button@^0.4.2:
protect-button@../protect-button/protect:
version "0.4.2"
resolved "https://registry.yarnpkg.com/protect-button/-/protect-button-0.4.2.tgz#6851255a4d7e0513e288a8130912ea9263d24226"
integrity sha512-Wm2QmCSTYaxFswjqEdsd8GHTxkExgM2nshV7ph+tdX7RjcSYbDLjvzGbBBpXDbaie/dNw7bNI9Mk37rOyLbzXA==
dependencies:
"@flashbots/mev-share-client" "file:../mev-share-client-ts"

proxy-addr@~2.0.7:
version "2.0.7"
Expand Down

0 comments on commit 4338ff5

Please sign in to comment.