Skip to content

Commit ef8df06

Browse files
authored
Remove TokenGate (#324)
* Remove `TokenGate` * Add changeset
1 parent 43b43da commit ef8df06

File tree

11 files changed

+6
-336
lines changed

11 files changed

+6
-336
lines changed

.changeset/cold-years-kiss.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@web3-ui/components': minor
3+
'@web3-ui/core': minor
4+
---
5+
6+
The `TokenGate` component has been removed since its implementation was insecure.

packages/components/README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ This is the list of components the package currently provides:
3535
- [NFT](#nft)
3636
- [NFTGallery](#nftgallery)
3737
- [Provider](#provider)
38-
- [TokenGate](#tokengate)
3938
- [EtherInput](#etherinput)
4039
- [TokenBalance](#tokenbalance)
4140

@@ -97,23 +96,6 @@ The Provider component is the `web3-ui` equivalent of ChakraUI's `ChakraProvider
9796

9897
---
9998

100-
### TokenGate
101-
102-
The TokenGate component lets you conditionally render some content depending on whether the user owns some quantity of tokens or not.
103-
104-
```tsx
105-
<TokenGate
106-
requiredQuantity={10}
107-
walletBalance={walletBalance}
108-
deniedMessage={<p>This will be rendered if walletBalance is less than 10.</p>}
109-
>
110-
<h1>You're eligible!</h1>
111-
<p>This will be rendered if walletBalance is greater than or equal to 10.</p>
112-
</TokenGate>
113-
```
114-
115-
---
116-
11799
### EtherInput
118100

119101
EtherInput is an input field that accepts values in _wei_ or _ether_. It always returns the value to you in _wei_ so that you can easily use it to interact with contracts without any conversions.

packages/components/src/components/TokenGate/TokenGate.stories.tsx

Lines changed: 0 additions & 115 deletions
This file was deleted.

packages/components/src/components/TokenGate/TokenGate.tsx

Lines changed: 0 additions & 39 deletions
This file was deleted.

packages/components/src/components/TokenGate/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/components/src/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export * from './Address';
55
export * from './NFTGallery';
66
export * from './NFT';
77
export * from './AddressInput';
8-
export * from './TokenGate';
98
export * from './EtherInput';
109
export * from './TokenBalance';
1110
export * from './MultiAddressInput';

packages/core/README.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ This is the list of components the package currently provides:
3333

3434
- [Provider](#provider)
3535
- [ConnectWallet](#connectwallet)
36-
- [TokenGate](#tokengate)
3736
- [TokenBalance](#tokenbalance)
3837

3938
---
@@ -71,29 +70,6 @@ import { ConnectWallet } from '@web3-ui/core';
7170

7271
---
7372

74-
### TokenGate
75-
76-
`TokenGate` lets you conditionally render some content depending on whether the current connected user has enough amount of a specific token. The component only supports ERC20 and ERC721 (NFTs) tokens at the moment but support for other standards is coming soon.
77-
78-
#### Usage
79-
80-
```tsx
81-
import { TokenGate } from '@web3-ui/core';
82-
83-
<TokenGate
84-
tokenContractAddress="0x08149745590e9025b52b6801e9dd3E752e60F3A2"
85-
requiredQuantity={+ethers.utils.parseEther('1')} // the component expects the amount in wei.
86-
deniedContent={
87-
<p>This message will show up if the user doesn't have enough tokens.</p>
88-
}
89-
tokenType="ERC721" // optional, defaults to ERC20
90-
>
91-
<h1>This message will be visible if the user has enough tokens.</h1>
92-
</TokenGate>;
93-
```
94-
95-
---
96-
9773
### TokenBalance
9874

9975
`TokeBalance` is a component that fetches and renders the balance of an ERC20 token for a given address.

packages/core/src/components/TokenGate/TokenGate.stories.tsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

packages/core/src/components/TokenGate/TokenGate.tsx

Lines changed: 0 additions & 73 deletions
This file was deleted.

packages/core/src/components/TokenGate/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)