Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refund handler implementations #3

Open
adambor opened this issue Dec 13, 2024 · 0 comments
Open

Refund handler implementations #3

adambor opened this issue Dec 13, 2024 · 0 comments

Comments

@adambor
Copy link
Member

adambor commented Dec 13, 2024

Create refund handlers, covering the basic cases for atomiq.

Timelock refund handler

Allows escrow to be refunded after a specific time in the future.

Example timelock in Solidity

contract Timelock {
    function refund(bytes32 refundData, bytes calldata _witness) view external {
        require(block.timestamp>uint256(refundData), "Not refundable yet");
    }
}

Blockheight refund handler

Allows escrow to be refunded after bitcoin blockchain reaches a specific blockheight. Depends on #2

Example blockheight lock in Solidity

contract BlockheightLock {
    BtcRelay public immutable btcRelay;

    function refund(bytes32 refundData, bytes calldata _witness) view external {
        require(btcRelay.blockheight>=uint256(refundData), "Not refundable yet");
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant