-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy contract and call example method stub.
- Loading branch information
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.8; | ||
|
||
import "suave-std/suavelib/Suave.sol"; | ||
|
||
contract Builder { | ||
function callback() external payable {} | ||
|
||
function example() external payable returns (bytes memory) { | ||
// address[] memory allowedList = new address[](1); | ||
// allowedList[0] = address(this); | ||
|
||
// Suave.DataRecord memory dataRecord = Suave.newDataRecord(10, allowedList, allowedList, "namespace"); | ||
|
||
// Suave.confidentialStore(dataRecord.id, "key1", abi.encode(1)); | ||
// Suave.confidentialStore(dataRecord.id, "key2", abi.encode(2)); | ||
|
||
// bytes memory value = Suave.confidentialRetrieve(dataRecord.id, "key1"); | ||
// require(keccak256(value) == keccak256(abi.encode(1))); | ||
|
||
// Suave.DataRecord[] memory allShareMatchBids = Suave.fetchDataRecords(10, "namespace"); | ||
return abi.encodeWithSelector(this.callback.selector); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
package main | ||
|
||
import "os" | ||
import ( | ||
"github.com/flashbots/suapp-examples/framework" | ||
) | ||
|
||
func main() { | ||
os.Exit(99) | ||
fr := framework.New() | ||
r := fr.Suave. | ||
DeployContract("builder.sol/Builder.json"). | ||
SendTransaction("example", []interface{}{}, nil) | ||
if r == nil { | ||
panic(r) | ||
} | ||
} |