https://github.com/0xmichalis/poison-pill
💊 On-chain defense against hostile takeovers
https://github.com/0xmichalis/poison-pill
Last synced: 2 months ago
JSON representation
💊 On-chain defense against hostile takeovers
- Host: GitHub
- URL: https://github.com/0xmichalis/poison-pill
- Owner: 0xmichalis
- Created: 2021-12-27T14:41:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-03T16:30:11.000Z (over 3 years ago)
- Last Synced: 2025-04-11T05:53:42.382Z (2 months ago)
- Language: Solidity
- Homepage:
- Size: 499 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Poison pill
[](https://github.com/996icu/996.ICU/blob/master/LICENSE)
On-chain defense against hostile takeovers. In layman's terms, this smart contract
only facilitates a discounted sale of shares to a whitelisted group.More info on the concept of a poison pill can be found below:
* https://www.investopedia.com/terms/p/poisonpill.asp
* https://twitter.com/GuardAOR/status/1476271943351427078## How to use
0. Off-chain process in `$TOKEN` entity (corporate or DAO) triggers the need to use a poison
pill. It is assumed that shares in the entity are represented as an ERC20 token.
1. Deploy the poison pill with an initial set of whitelisted accounts. The whitelist can
also be updated post-deployment. There are two ways to facilitate a discount on `$TOKEN` via
this contract:
* set `_tokenOracle` to a price oracle that supports the [`IPriceOracle`](./contracts/interfaces/IPriceOracle.sol) interface, eg. Chainlink.
Set `_discountBP` to the basis points you want to discount from the market price returned from the price oracle.
* if no `$TOKEN` price feed exists on-chain, it is still possible to maintain the market
price of `$TOKEN` manually directly in the contract via `_price`. At this point, you can either
set `_price` directly to the discounted price, in which case `_discountBP` should be set to zero,
or set to market price and specify the discount separately.
2. Once the contract is deployed, the last step that needs to happen before the sale starts is to move
the funds to sell from the entity's treasury to the smart contract. The ultimate goal of the pill is to
deter some attacker who tries to take over the entity and/or bring them to the negotiation table. This means
that it is up to the entity's management to determine how to execute the poison pill, before the attacker
backs outs. Hence, this step can be repeated more than once, eg., entity agrees to start selling batches of
their treasury and not all of it in one go. Obviously, this process is out of scope of the smart contract
but it can still be facilitated.
3. Now, whitelisted users can use `$WETH` or `$USDC` to start buying `$TOKEN` in discount.
4. Any acquired `$WETH` or `$USDC` can be withdrawn by anyone back to the treasury.[Forge](https://github.com/gakonst/foundry/tree/master/forge) is used under the [hood](https://www.gnu.org/software/make/) to build, test, and deploy the contract.
## Build
```
make build
```## Test
```
make test
```Find a variety of Chainlink feeds to test with at https://market.link.
## Deploy in Ropsten
Update the `deploy-ropsten` target in Makefile with your own parameters, then:
```
make deploy-ropsten
```## Disclaimer
These smart contracts are being provided as is. No guarantee, representation, or warranty is being made,
express or implied, as to the safety or correctness of any code provided in this repository. The contracts
have not been audited and as such there can be no assurance they will work as intended, and users may
experience delays, failures, errors, omissions, loss of transmitted information, or loss of funds. The
original author is not liable for any of the foregoing. Users should proceed with caution and use at their
own risk. On top of this, nothing in this repository constitutes legal advice. Please advise with a lawyer
before executing the poison pill strategy.