Solidity Examples
Cross-chain execution traditionally requires bridges, callbacks, and waiting periods. Signet’s Orders system provides an alternative approach where fillers compete to satisfy same-block atomic actions.
Signet Orders specify inputs and outputs same-chain or cross-chain. Rather than building complex bridge infrastructure, applications can post Orders that market participants fulfill based on the opportunities they unlock. Fillers might satisfy an Order not just for direct profit, but because it opens opportunities across Signet or Ethereum. This creates a competitive marketplace where execution value extends beyond the immediate Order into more sophisticated designs.
Implementation
The signet-sol repository demonstrates how Orders work in practice, from flash loans that don’t require liquidity pools to payment systems that operate without msg.value.
Auto-Configuration
Applications inherit automatic system configuration across networks through chain ID detection, eliminating manual address management and enabling immediate Order functionality.
1// SignetStd.sol - auto-configures based on chain
2import {SignetStd} from "./SignetStd.sol";
3
4contract MyApp is SignetStd {
5 // Signet system parameters automatically configured
6 // No manual address management needed
7
8 function myFunction() external {
9 // Can immediately use helper functions for creating orders
10 RollupOrders.Input[] memory inputs = new RollupOrders.Input[](1);
11 inputs[0] = makeInput(address(WUSD), 100 * 1e6);
12
13 RollupOrders.Output[] memory outputs = new RollupOrders.Output[](1);
14 outputs[0] = hostEthOutput(0.05 ether, msg.sender);
15
16 ORDERS.initiate(
17 block.timestamp,
18 inputs,
19 outputs
20 );
21 }
22}
github.com/init4tech/signet-sol/SignetStd.sol
Deploy the same contract code across all networks without modification.
Flash Loans
Orders enable flash loans through just-in-time liquidity from competitive fillers, removing the need for pre-existing liquidity pools.
1// Flash.sol - provides flash modifier
2abstract contract Flash is SignetStd {
3 modifier flash(address asset, uint256 amount) {
4 _;
5
6 // Output is received *before* the modified function is called
7 RollupOrders.Output[] memory outputs = new RollupOrders.Output[](1);
8 outputs[0] = makeRollupOutput(asset, amount, address(this));
9
10 // Input is sent back after the modified function
11 RollupOrders.Input[] memory inputs = new RollupOrders.Input[](1);
12 inputs[0] = makeInput(asset, amount);
13
14 ORDERS.initiate(
15 block.timestamp, // this is equivalent to no deadline
16 inputs,
17 outputs
18 );
19 }
20}
github.com/init4tech/signet-sol/Flash.sol
Payment Gates
Orders allow contracts to require payments without directly managing funds, creating market-driven execution gates.
1// PayMe.sol - payment gate implementation
2abstract contract PayMe is SignetStd {
3 modifier payMe(uint256 amount) {
4 _;
5 demandPayment(NATIVE_ASSET, amount);
6 }
7
8 modifier payMeSubsidizedGas(uint256 amount) {
9 uint256 pre = gasleft();
10 uint256 gp = tx.gasprice;
11 _;
12 uint256 post = gasleft();
13 uint256 loot = amount - (gp * (pre - post));
14 demandPayment(NATIVE_ASSET, loot);
15 }
16
17 function demandPayment(address asset, uint256 amount) internal {
18 RollupOrders.Output[] memory outputs = new RollupOrders.Output[](1);
19 outputs[0] = makeRollupOutput(asset, amount, address(this));
20
21 ORDERS.initiate(
22 block.timestamp,
23 new RollupOrders.Input[](0), // no inputs
24 outputs
25 );
26 }
27}
github.com/init4tech/signet-sol/PayMe.sol
Turn execution costs into revenue opportunities for fillers.
Incentivized Execution
Applications can offer bounties for function execution, turning computational costs into revenue opportunities for fillers.
1// PayYou.sol - bounty-driven execution
2abstract contract PayYou is SignetStd {
3 modifier paysYou(uint256 tip) {
4 _;
5 providePayment(NATIVE_ASSET, tip);
6 }
7
8 modifier paysYourGas(uint256 tip) {
9 uint256 pre = gasleft();
10 uint256 gp = tx.gasprice;
11 _;
12 uint256 post = gasleft();
13 uint256 loot = tip + (gp * (pre - post));
14 providePayment(NATIVE_ASSET, loot);
15 }
16
17 function providePayment(address asset, uint256 amount) internal {
18 RollupOrders.Input[] memory inputs = new RollupOrders.Input[](1);
19 inputs[0] = makeInput(asset, amount);
20
21 ORDERS.initiate{value: amount}(
22 block.timestamp, // no deadline
23 inputs,
24 new RollupOrders.Output[](0) // no outputs
25 );
26 }
27}
github.com/init4tech/signet-sol/PayYou.sol
Post a bounty Order before executing computation. Fillers compete to claim the reward by calling the function, creating an execution scheduling system.
Instant Exits
Orders enable immediate rollup exits through market makers who provide instant L1 liquidity in exchange for small fees.
1// GetOut.sol - immediate exit mechanism
2contract GetOut is SignetStd {
3 error MissingValue();
4
5 receive() external payable {
6 getOut();
7 }
8
9 function getOut() public payable {
10 require(msg.value > 0, MissingValue());
11
12 uint256 desired = msg.value * 995 / 1000; // 0.5% fee
13
14 RollupOrders.Input[] memory inputs = new RollupOrders.Input[](1);
15 inputs[0] = makeInput(NATIVE_ASSET, msg.value);
16
17 RollupOrders.Output[] memory outputs = new RollupOrders.Output[](1);
18 outputs[0] = hostUsdcOutput(desired, msg.sender);
19
20 ORDERS.initiate{value: msg.value}(
21 block.timestamp,
22 inputs,
23 outputs
24 );
25 }
26}
github.com/init4tech/signet-sol/GetOut.sol
Implications
Order execution happens atomically within a single block, from submission through settlement. Signet makes cross-chain synchronous composability possible. MEV capture becomes application-directed. Applications can design for their MEV rather than blindly leaking it. Capital efficiency improves through demand-driven liquidity. Flash loans come from competitive filler inventory rather than idle or unproductive pool reserves.
Rethinking Rollups
Signet improves how cross-chain applications are built. Instead of building around the limitations of third party bridges and asynchronous messaging, applications benefit from instant cross-chain execution. Signet enables entirely new categories of applications— from flash loans without pools to payment gates without cash flow management. Signet-sol is just the beginning of what we can offer. Signet’s Orders system turns cross-chain operations into first-class primitives, enabling cross-chain simplicity and composability.
Build with Signet:
- Testnet Faucet for testnet USD
- Orders Documentation for technical specifications
- Example Contracts for all implementation patterns