so I really want to create a smart contract for the community to use - one where two people can easily and trustlessly make a bet between each other. V1 of the smart contract would be where two people (or more) bet that cryptocurrency pair X will reach the price of Y by a certain date Q. Once the condition is met, the funds are released to the winner.
It is one of my first smart contracts, I appreciate any help I can get. I know it is far from finished, but maybe someone can point me in the right direction? Would be greatly appreciated. I have a cool and useful product in mind :)
Once the Betting contract is finished, I will want to hook it up with Chainlink decentralized oracle to provide data to the blockchain. Oh, and I would like the dApp to run on Matic.
Where can I learn to do it? I've been watching videos and trying, but I think I reached a point where I can learn further only by trying to do it myself.
'''
pragma solidity ^0.6.7;
contract Betting {
enum State { Created, Locked, Released }
struct Bet {
string pair;
uint price;
uint date;
}
event BetMade(address bettor, uint amount);
function bet() public payable {
emit BetMade(msg.sender, msg.value);
}
}
'''