Hey, guys. I need to write a smart-contract, where users make a bet on some event and after a while outcome is announced and winners get percentage of total bank.
Does anybody know smart-contracts I can take as a reference?
Aug 13, 2022, 5:41 PM
will the privileged contract owner announce the result? (trust)
Aug 13, 2022, 5:46 PM
The outcome will depend on cryptocurrency courses. I haven't decided how to do it yet, either I'll use my backend and api of some crypto market to fetch current courses and notify smart-contract, or maybe defi oracle.
Personally I want to use custom backend. Once backend knows the outcome, it must notify smart-contract and send funds to winners.
Personally I want to use custom backend. Once backend knows the outcome, it must notify smart-contract and send funds to winners.
Aug 13, 2022, 5:52 PM
price prediction?
see pancakes: https://docs.pancakeswap.finance/code/smart-contracts/prediction-v2
Aug 13, 2022, 5:54 PM
Kind of. Users will bet whether the specific cryptocurrency will grow or fall for next 1/5/30 mins.
Thanks, bro. I'll take a look.
Aug 13, 2022, 5:54 PM
i think v1 was exploited.. same could likely happen with v2 , dunno
Aug 13, 2022, 5:55 PM
Exploited by who and when?
Aug 13, 2022, 6:14 PM
maybe was just buggy
still has 500 bnb in contract.. weird https://bscscan.com/address/0x516ffd7D1e0Ca40b1879935B2De87cb20Fc1124b
still has 500 bnb in contract.. weird https://bscscan.com/address/0x516ffd7D1e0Ca40b1879935B2De87cb20Fc1124b
Aug 13, 2022, 6:17 PM