Skip to content

Commit

Permalink
Deploy contract and call example method stub.
Browse files Browse the repository at this point in the history
  • Loading branch information
lthibault committed Feb 21, 2024
1 parent 9c791f4 commit bb7062b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
24 changes: 24 additions & 0 deletions examples/builder/builder.sol
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);
}
}
12 changes: 10 additions & 2 deletions examples/builder/main.go
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)
}
}

0 comments on commit bb7062b

Please sign in to comment.