Coindays Airdrop Token

This is an idea to create a competing token to badgers.cash, but to skip the waiting period where some principal is time-locked by a vault.

Instead, a user that holds some aged unspent output may claim tokens from a contract thread, as long as their utxo is older than that thread. Users with more coins can release more tokens from the vault.

This contract could be deployed as a super multi-threaded airdrop contract rewarding users for coindays on utxos they already have.

Hundreds of Utxos can be seeded with a coinday airdrop token thread, any user with a utxo exceeding the age of a thread can claim tokens proportional to the value of their utxo and the age of the thread.

May be combined with a cauldron swap to bring back coinday paid “free” “zero-fee” transactions.

contract CoinDayAirDrop() {

    function release(int age) {

        // Force a block based relative timelock
        // 0065cd1d OP_OVER OP_GREATERTHANOREQUAL OP_VERIFY
        require(500000000 >= age);

        // Ensure the first input exceeds the age claimed
        // OP_0 OP_INPUTSEQUENCENUMBER OP_OVER OP_GREATERTHANOREQUAL OP_VERIFY
        require(tx.inputs[0].sequenceNumber >= age);
        
        // Require the token vault thread to exceed the age claimed
        // OP_DUP OP_CHECKSEQUENCEVERIFY OP_DROP
        require(this.age >= age);

        // Allow anyone to withdraw a token amount proportional to the value of their aged utxo.
        // Note: to convert block satoshis to coindays: 144 * 100_000_000 
        // 
        // OP_INPUTINDEX OP_OUTPUTTOKENAMOUNT 
        // OP_INPUTINDEX OP_UTXOTOKENAMOUNT 
        // OP_ROT OP_0 OP_UTXOVALUE OP_MUL 00904e5a03 OP_DIV OP_SUB OP_GREATERTHANOREQUAL
        require(
            tx.outputs[this.activeInputIndex].tokenAmount >= 
            tx.inputs[this.activeInputIndex].tokenAmount - 
            (age * tx.inputs[0].value/14400000000)
        );

        // This thread must be in the last input position
        // to prevent users building transactions with multiple airdrop threads. 
        //
        // OP_INPUTINDEX OP_1ADD OP_TXINPUTCOUNT OP_NUMEQUAL
        require(this.activeInputIndex+1 == tx.inputs.length);
    }
}