Skip to content

Commit 2cbd258

Browse files
committed
minimal app changes
1 parent 1a451e7 commit 2cbd258

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

entropy/coin_flip/app/src/coin_flip_abi.ts

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,54 @@ export const ICoinFlipAbi = [
2323
"outputs": [],
2424
"stateMutability": "nonpayable"
2525
},
26+
{
27+
"type": "function",
28+
"name": "getDefaultProviderGasLimit",
29+
"inputs": [],
30+
"outputs": [{ "name": "", "type": "uint32", "internalType": "uint32" }],
31+
"stateMutability": "view"
32+
},
2633
{
2734
"type": "function",
2835
"name": "getFlipFee",
2936
"inputs": [],
30-
"outputs": [
31-
{ "name": "fee", "type": "uint256", "internalType": "uint256" }
32-
],
37+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
3338
"stateMutability": "view"
3439
},
3540
{
3641
"type": "function",
3742
"name": "requestFlip",
43+
"inputs": [],
44+
"outputs": [],
45+
"stateMutability": "payable"
46+
},
47+
{
48+
"type": "function",
49+
"name": "requestFlipWithCustomGasLimit",
50+
"inputs": [
51+
{ "name": "gasLimit", "type": "uint32", "internalType": "uint32" }
52+
],
53+
"outputs": [],
54+
"stateMutability": "payable"
55+
},
56+
{
57+
"type": "function",
58+
"name": "requestFlipWithCustomProviderAndGasLimit",
59+
"inputs": [
60+
{ "name": "provider", "type": "address", "internalType": "address" },
61+
{ "name": "gasLimit", "type": "uint32", "internalType": "uint32" }
62+
],
63+
"outputs": [],
64+
"stateMutability": "payable"
65+
},
66+
{
67+
"type": "function",
68+
"name": "requestFlipWithCustomProviderAndGasLimitAndUserContribution",
3869
"inputs": [
70+
{ "name": "provider", "type": "address", "internalType": "address" },
71+
{ "name": "gasLimit", "type": "uint32", "internalType": "uint32" },
3972
{
40-
"name": "userRandomNumber",
73+
"name": "userContribution",
4174
"type": "bytes32",
4275
"internalType": "bytes32"
4376
}

entropy/coin_flip/app/src/flip_coin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async function main() {
8787

8888
console.log("\n3. Sending request to flip coin...");
8989

90-
const flipTxHash = await coinFlipContract.write.requestFlip([randomNumber], {
90+
const flipTxHash = await coinFlipContract.write.requestFlip({
9191
value: flipFee,
9292
});
9393
console.log(`Transaction Hash: ${flipTxHash}`);

entropy/coin_flip/contract/src/CoinFlip.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,9 @@ contract CoinFlip is IEntropyConsumer {
120120
return address(entropy);
121121
}
122122

123+
function getFlipFee() public view returns (uint256) {
124+
return entropy.getFeeV2();
125+
}
126+
123127
receive() external payable {}
124128
}

0 commit comments

Comments
 (0)