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
// In this example, we will go over how to look up a Celo address that is registered with a phone number with ODIS | |
// 1. Import the appropriate packages | |
const ContractKit = require('@celo/contractkit') | |
const OdisUtils = require('@celo/identity').OdisUtils | |
const id = require('@celo/identity') | |
const Web3 = require('web3') | |
require('dotenv').config() | |
// 2. Import these packages to help with private key management for the example |
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
import React, { useCallback, useEffect, useState } from 'react' | |
import { useContractKit } from '@celo-tools/use-contractkit'; | |
import { ContractKitProvider } from '@celo-tools/use-contractkit'; | |
import '@celo-tools/use-contractkit/lib/styles.css'; | |
function App () { | |
const { address, connect } = useContractKit() | |
return ( | |
<main> |
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
import logo from './celoLogo.svg'; | |
import './App.css'; | |
import WalletConnectProvider from '@walletconnect/web3-provider'; | |
import Web3 from 'web3'; | |
import React from 'react'; | |
import { newKitFromWeb3 } from '@celo/contractkit'; | |
class App extends React.Component { | |
constructor(props){ |
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
// SPDX-License-Identifier: MIT | |
/** | |
*Submitted for verification at BscScan.com on 2021-05-29 | |
*/ | |
// File: @openzeppelin/contracts/utils/Context.sol | |
// SPDX-License-Identifier: MIT | |
pragma solidity 0.7.0; |
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
pragma solidity 0.5.3; | |
pragma solidity 0.5.3; | |
/** | |
* @dev Contract module that helps prevent reentrant calls to a function. | |
* | |
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier | |
* available, which can be applied to functions to make sure there are no nested | |
* (reentrant) calls to them. |
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
{ | |
"compiler": { | |
"version": "0.5.3+commit.10d17f24" | |
}, | |
"language": "Solidity", | |
"output": { | |
"abi": [ | |
{ | |
"constant": false, | |
"inputs": [ |
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
const Web3 = require('web3') | |
const ContractKit = require('@celo/contractkit') | |
const web3 = new Web3(`https://celo-alfajores--rpc.datahub.figment.io/apikey/${process.env.FIGMENT_API_KEY}/`) | |
async function sendCELOTx(){ | |
// Connect to the network and get the current tx count | |
let nonce = await kit.web3.eth.getTransactionCount(kit.defaultAccount) | |
// Send 0.1 CELO |
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
#!/bin/bash | |
string="sdk-docs/contractkit/" | |
for f in docs/**/_*; do | |
newfile="$(echo ${f} | sed -e 's/\_//')"; | |
line=$(head -n 1 $f); | |
title="$(echo ${line} | sed -e 's/.*://')"; | |
echo -e "---\ntitle: ${title}\nslug: $string/${f}\n---\n\n$(cat $f)" > $f | |
mv $f $newfile; |
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
import { StatusBar } from 'expo-status-bar'; | |
import React, { useEffect, useState } from 'react'; | |
import { StyleSheet, ScrollView, Text, View, TextInput, Pressable, Linking } from 'react-native'; | |
import { magic, web3 } from './magic'; | |
import { abi } from './contract/abi.js'; | |
export default function App() { | |
// User | |
const [email, setEmail] = useState(''); | |
const [user, setUser] = useState(''); |
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
import './App.css'; | |
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import { WalletConnectWallet } from '@celo/wallet-walletconnect' | |
import QRCode from 'qrcode.react' | |
class App extends React.Component { | |
constructor(props){ | |
super(props) |