Skip to content

Multi-sig Bitcoin Smart Contract is a powerful solution that addresses the limitation of the Bitcoin network by providing increased speed and security for Bitcoin transaction. It creates a "lightning network" on top of the Bitcoin network, allowing multiple transections without having to broadcast them to the entire network.

License

Notifications You must be signed in to change notification settings

CTG-TOKEN/MsB.sol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

pragma solidity ^0.8.0;

contract MultiSigWallet { address[] public owners; mapping(address => bool) public isOwner; address public owner; address public spender; address public recipient; uint public value;

constructor(address[] memory _owners) public {
    owners = _owners;
    for (uint i = 0; i < owners.length; i++) {
        isOwner[owners[i]] = true;
    }
}

function execute(address _spender, address _recipient, uint _value) public {
    require(isOwner[msg.sender], "Sender is not an owner of the contract");
    require(isOwner[spender], "Spender is not an owner of the contract");
    spender = _spender;
    recipient = _recipient;
    value = _value;
}

function confirm(address _spender, address _recipient, uint _value) public {
    require(spender == _spender, "Spender does not match the transaction");
    require(recipient == _recipient, "Recipient does not match the transaction");
    require(value == _value, "Value does not match the transaction");
    require(isOwner[msg.sender], "Sender is not an owner of the contract");
    spender.transfer(_value);
}

}

About

Multi-sig Bitcoin Smart Contract is a powerful solution that addresses the limitation of the Bitcoin network by providing increased speed and security for Bitcoin transaction. It creates a "lightning network" on top of the Bitcoin network, allowing multiple transections without having to broadcast them to the entire network.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages