Skip to content

Commit bb7062b

Browse files
committed
Deploy contract and call example method stub.
1 parent 9c791f4 commit bb7062b

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

examples/builder/builder.sol

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity ^0.8.8;
3+
4+
import "suave-std/suavelib/Suave.sol";
5+
6+
contract Builder {
7+
function callback() external payable {}
8+
9+
function example() external payable returns (bytes memory) {
10+
// address[] memory allowedList = new address[](1);
11+
// allowedList[0] = address(this);
12+
13+
// Suave.DataRecord memory dataRecord = Suave.newDataRecord(10, allowedList, allowedList, "namespace");
14+
15+
// Suave.confidentialStore(dataRecord.id, "key1", abi.encode(1));
16+
// Suave.confidentialStore(dataRecord.id, "key2", abi.encode(2));
17+
18+
// bytes memory value = Suave.confidentialRetrieve(dataRecord.id, "key1");
19+
// require(keccak256(value) == keccak256(abi.encode(1)));
20+
21+
// Suave.DataRecord[] memory allShareMatchBids = Suave.fetchDataRecords(10, "namespace");
22+
return abi.encodeWithSelector(this.callback.selector);
23+
}
24+
}

examples/builder/main.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
package main
22

3-
import "os"
3+
import (
4+
"github.com/flashbots/suapp-examples/framework"
5+
)
46

57
func main() {
6-
os.Exit(99)
8+
fr := framework.New()
9+
r := fr.Suave.
10+
DeployContract("builder.sol/Builder.json").
11+
SendTransaction("example", []interface{}{}, nil)
12+
if r == nil {
13+
panic(r)
14+
}
715
}

0 commit comments

Comments
 (0)