This contract will give you access to set an ad on https://kiwinews.xyz. The ad will be, for example, permanently available as the top fourth link here:
At the time of writing, we reach roughly 150-400 individuals in the crypto space a day. But we have no idea how much it'd be worth to advertise to these people, hence the smart contract. It'll help us do price discovery. So how does it work?
Basically, you can stake an amount of ETH for the contract to be yours. Say you stake 1 ETH, then you'll get to set the title, link, and you'll own the contract. But over 1 month, we'll charge you 1 ETH in fees (100% of the collateral a month). The ETH staked as collateral in the contract is also the price someone has to pay to acquire the ad from you. Here's an example:
- Day 0: You stake 1 ETH in collateral. The price to transfer the ad is 1 ETH.
- Day 15 (half a month): Now half of your collateral was taxed (0.5 ETH). The price to transfer the ad is 0.5 ETH. Your remaining collateral is 0.5 ETH.
- Day 30 (month): Your ad is about to be taken off the website. In case noone has bought yet, your collateral now is very low 0.0000...1 ETH, and so for someone else to buy the ad space from you is extremely cheap.
Now, what would happen if someone bought your ad for 0.9 ETH on Day 15?
- The contract sends your leftover collateral back to you (0.5 ETH).
- The buyer's transfer fee of 0.5 ETH is sent to you too.
- The remainder of the buyer's value (0.4 ETH) is staked as collateral and is the new price (0.4 ETH) to transfer the ad.
- The taxed collateral (0.5 ETH) is sent the the Kiwi News treasury.
Here are the account balances of everyone:
- You: 1 ETH
- Ad contract: 0.4 ETH (buyer's collateral)
- Kiwi News treasury: 0.5 ETH
You may have heard of this concept earlier. It's often referred to as Harberger taxes, or Partial common ownership. Check out this talk from Devcon SEA about "Demand-based recurring fees in practice" to learn more.
Go to https://news.kiwistand.com/submit and check "Submit as an ad."
CREATE2 is used to deploy the contract to a deterministic address independent of chainId.
DEPLOYER
: 0x0000000000ffe8b47b3e2130213b802212439497SALT
: 0x0000000000000000000000000000000000000000f00df00df00df00df00df00dINITCODE
: 0x608060405234801561001057600080fd5b5060016000556108ad806100256000396000f3fe60806040526004361061007b5760003560e01c8063b80777ea1161004e578063b80777ea14610101578063d8dfeb4514610125578063e942b5161461013b578063f77c47911461014e57600080fd5b806336eeaa6a146100805780634a79d50c146100ab578063824ca7e9146100c0578063a035b1fe146100d7575b600080fd5b34801561008c57600080fd5b50610095610186565b6040516100a291906105bc565b60405180910390f35b3480156100b757600080fd5b50610095610214565b3480156100cc57600080fd5b506100d5610221565b005b3480156100e357600080fd5b506100ec6102b3565b604080519283526020830191909152016100a2565b34801561010d57600080fd5b5061011760055481565b6040519081526020016100a2565b34801561013157600080fd5b5061011760045481565b6100d5610149366004610653565b6102f0565b34801561015a57600080fd5b5060035461016e906001600160a01b031681565b6040516001600160a01b0390911681526020016100a2565b60028054610193906106bf565b80601f01602080910402602001604051908101604052809291908181526020018280546101bf906106bf565b801561020c5780601f106101e15761010080835404028352916020019161020c565b820191906000526020600020905b8154815290600101906020018083116101ef57829003601f168201915b505050505081565b60018054610193906106bf565b3373ee324c588cef1bf1c1360883e4318834af66366d1461025557604051636609677b60e11b815260040160405180910390fd5b60405173ee324c588cef1bf1c1360883e4318834af66366d904790600081818185875af1925050503d80600081146102a9576040519150601f19603f3d011682016040523d82523d6000602084013e505050565b606091505b505050565b6000806102e86040518060400160405280600181526020016228206e815250600554426102e0919061070f565b6004546104b4565b915091509091565b6102f86104f2565b6003546001600160a01b031661034357600161031584868361078c565b50600261032382848361078c565b50600380546001600160a01b0319163317905534600455426005556104a4565b60008061034e6102b3565b909250905061035e82600161084d565b34101561037e576040516349798bf960e11b815260040160405180910390fd5b6003546001600160a01b0316600161039787898361078c565b5060026103a585878361078c565b50600380546001600160a01b031916331790556103c2833461070f565b60045542600555604051600090731337e2624ffec537087c6774e9a18031cfeaf0a99084908381818185875af1925050503d806000811461041f576040519150601f19603f3d011682016040523d82523d6000602084013e610424565b606091505b50509050806104465760405163716a44a560e11b815260040160405180910390fd5b6001600160a01b03821661045b856002610860565b604051600081818185875af1925050503d8060008114610497576040519150601f19603f3d011682016040523d82523d6000602084013e61049c565b606091505b505050505050505b6104ae6001600055565b50505050565b60008060006104c486868661054f565b9050808410156104db5760008492509250506104ea565b6104e5818561070f565b925090505b935093915050565b6002600054036105485760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640160405180910390fd5b6002600055565b8251600090610592906105628585610860565b61056c9190610860565b670de0b6b3a764000086602001516105849190610860565b670de0b6b3a764000061059a565b949350505050565b8281028215158415858304841417166105b257600080fd5b9190910492915050565b600060208083528351808285015260005b818110156105e9578581018301518582016040015282016105cd565b506000604082860101526040601f19601f8301168501019250505092915050565b60008083601f84011261061c57600080fd5b50813567ffffffffffffffff81111561063457600080fd5b60208301915083602082850101111561064c57600080fd5b9250929050565b6000806000806040858703121561066957600080fd5b843567ffffffffffffffff8082111561068157600080fd5b61068d8883890161060a565b909650945060208701359150808211156106a657600080fd5b506106b38782880161060a565b95989497509550505050565b600181811c908216806106d357607f821691505b6020821081036106f357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610722576107226106f9565b92915050565b634e487b7160e01b600052604160045260246000fd5b601f8211156102ae57600081815260208120601f850160051c810160208610156107655750805b601f850160051c820191505b8181101561078457828155600101610771565b505050505050565b67ffffffffffffffff8311156107a4576107a4610728565b6107b8836107b283546106bf565b8361073e565b6000601f8411600181146107ec57600085156107d45750838201355b600019600387901b1c1916600186901b178355610846565b600083815260209020601f19861690835b8281101561081d57868501358255602094850194600190920191016107fd565b508682101561083a5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b80820180821115610722576107226106f9565b8082028115828204841417610722576107226106f956fea2646970667358221220150854be49337bad1a543caa80002b9c031cf029cc5295298073ba25dfe53fb664736f6c63430008110033ADDRESS
: 0xffcc6b6c5c066b23992758a4fc408f09d6cc4eda- Deployed to:
- Optimism
ETHERSCAN_API_KEY=abc forge verify-contract address Ad --watch --chain 10
SPDX-License-Identifier: AGPL-3.0