Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions build-on-celo/build-with-farcaster.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function SendTransaction() {

const handleSend = () => {
sendTransaction({
to: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
to: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", // example recipient — replace
value: parseEther("0.01"),
});
};
Expand Down Expand Up @@ -188,11 +188,11 @@ function BatchTransfer() {
sendCalls({
calls: [
{
to: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
to: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", // example recipient — replace
value: parseEther("0.01"),
},
{
to: "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
to: "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC", // example recipient — replace
value: parseEther("0.02"),
},
],
Expand Down Expand Up @@ -225,14 +225,14 @@ function ApproveAndSwap() {
abi: erc20Abi,
functionName: "approve",
args: [
"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", // Router address
"0xYourSwapRouterAddress", // a router deployed on Celo — see /tooling/contracts/uniswap-contracts
parseUnits("100", 6), // Amount
],
}),
},
// Swap USDC for CELO
{
to: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", // Uniswap Router
to: "0xYourSwapRouterAddress", // a router deployed on Celo — see /tooling/contracts/uniswap-contracts
data: encodeFunctionData({
abi: uniswapAbi,
functionName: "swapExactTokensForETH",
Expand All @@ -249,6 +249,10 @@ function ApproveAndSwap() {
}
```

<Warning>
The swap example is a shape, not a recipe: the router address must be one deployed on Celo — pick it from [Uniswap contracts on Celo](/tooling/contracts/uniswap-contracts) — and the ABI must match that router (Celo has Uniswap v3/v4; the v2-style `swapExactTokensForETH` shown here will not work against them unchanged).
</Warning>

<Info>
**Limitations:**
- Transactions execute sequentially, not atomically
Expand Down
4 changes: 2 additions & 2 deletions tooling/oracles/band-protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This tutorial will go over:
<img src="/img/doc-images/band-protocol-how-to/remix-environment.png" alt="environment" width="400" />
</Frame>

1. Enter the Celo Sepolia testnet Band reference data aggregator contract address [`0x8c064bCf7C0DA3B3b090BAbFE8f3323534D84d68`](https://docs.bandchain.org/develop/supported-blockchains/#testnets) to the `DemoOracle` constructor and deploy the contract. You can access the reference data aggregator contract on Mainnet at [`0xDA7a001b254CD22e46d3eAB04d937489c93174C3`](https://docs.bandchain.org/develop/supported-blockchains/#mainnets). Make sure you check the **current address** on their page, as it might happen that they updated their reference contract and then your Oracle data will not be correct anymore.
1. Enter the Band reference-data aggregator contract address for your network into the `DemoOracle` constructor and deploy the contract. Copy the current address for Celo from Band's [supported blockchains page](https://docs.bandchain.org/develop/supported-blockchains/) — Band updates the reference contract from time to time, and a stale address returns stale data.

<Frame>
<img src="/img/doc-images/band-protocol-how-to/deploy.png" alt="environment" />
Expand Down Expand Up @@ -62,7 +62,7 @@ The "savePrice" function will save any base/quote rate that is passed to it in t

## Mainnet Reference Data Contract

You can access the reference data aggregator contract on Mainnet at [`0xDA7a001b254CD22e46d3eAB04d937489c93174C3`](https://docs.bandchain.org/develop/supported-blockchains/#mainnets).
Copy the current mainnet reference-data aggregator address from Band's [supported blockchains page](https://docs.bandchain.org/develop/supported-blockchains/).

## Available Reference Data

Expand Down
9 changes: 3 additions & 6 deletions tooling/oracles/wit-oracle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ The ***WitnetPriceRouter*** smart contract is deployed in all the [supported cha

**WitnetProxy**

- *Alfajores*: [0x1111AbA2164AcdC6D291b08DfB374280035E1111](https://alfajores.celoscan.io/address/0x1111AbA2164AcdC6D291b08DfB374280035E1111)
- *Mainnet*: [0x1111AbA2164AcdC6D291b08DfB374280035E1111](https://celo.blockscout.com/address/0x1111AbA2164AcdC6D291b08DfB374280035E1111)
Copy the current `WitnetProxy` address for your network from Witnet's [Celo price feeds page](https://docs.witnet.io/smart-contracts/witnet-data-feeds/addresses/celo-price-feeds); live feeds and their update history are on [feeds.witnet.io/celo](https://feeds.witnet.io/celo). Witnet rotates these contracts, so always read the address from their catalog rather than hardcoding one.


The Witnet Proxy contract is the easiest and most convenient way to consume Witnet price feeds on any of the [supported chains](https://docs.witnet.io/smart-contracts/supported-chains).
Expand Down Expand Up @@ -75,7 +74,7 @@ You may also read the latest price of supported currency pairs from your **Web3*
```javascript
web3 = Web3(Web3.HTTPProvider('https://forno.celo.org'))
abi = '[{ "inputs": [{ "internalType": "bytes32", "name": "_id", "type": "bytes32" }], "name": "valueFor", "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }, { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }]'
addr = '0x1111AbA2164AcdC6D291b08DfB374280035E1111'
addr = '<WitnetProxy address for Celo>' // copy from docs.witnet.io -> Celo price feeds
contract = web3.eth.contract(address=addr, abi=abi)
// get last value for "Price-CELO/USD-6"
valueFor = contract.functions.valueFor().call("0x9ed884be")
Expand All @@ -98,9 +97,7 @@ Crowd‑witnessed random seed generation
A randomized subset of Witnet nodes each generate secret random bytes, commit and later reveal them. These are deterministically aggregated into a tamper‑proof seed—unbiased and unpredictable as long as at least one witness is honest.

The WitnetRandomness contract is already deployed on Celo and other supported chains. It exposes a simple interface via IWitnetRandomness, available in the witnet‑solidity‑bridge npm package
- Alfajores: [0xC0FFEE98AD1434aCbDB894BbB752e138c1006fAB](https://alfajores.celoscan.io/address//0xC0FFEE98AD1434aCbDB894BbB752e138c1006fAB)

- Mainnet: [0xC0FFEE98AD1434aCbDB894BbB752e138c1006fAB](https://celo.blockscout.com/address/0xC0FFEE98AD1434aCbDB894BbB752e138c1006fAB)
Copy the current randomness-contract address for your network from Witnet's [contract addresses page](https://docs.witnet.io/smart-contracts/witnet-randomness-oracle/contract-addresses).

This very basic example shows how easy is to source random uint32 values into your own contracts:

Expand Down