Skip to content

Commit

Permalink
Schema registry code, changes to deploy script to deploy on sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
KohliSuraj committed Jun 22, 2024
1 parent b3b72ab commit 08fb539
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 174 deletions.
244 changes: 113 additions & 131 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@

const deployedContracts = {
devnet: {
YourContract: {
address:
"0x044565ce852d3eb78527b6746a07a77abef4fc6a31de461f864f652f950242a0",
SchemaRegistry: {
abi: [
{
type: "impl",
name: "YourContractImpl",
interface_name: "contracts::YourContract::IYourContract",
name: "SchemaRegistryImpl",
interface_name: "contracts::SchemaRegistry::ISchemaRegistry",
},
{
type: "struct",
Expand All @@ -32,20 +30,6 @@ const deployedContracts = {
},
],
},
{
type: "struct",
name: "core::integer::u256",
members: [
{
name: "low",
type: "core::integer::u128",
},
{
name: "high",
type: "core::integer::u128",
},
],
},
{
type: "enum",
name: "core::bool",
Expand All @@ -62,197 +46,195 @@ const deployedContracts = {
},
{
type: "interface",
name: "contracts::YourContract::IYourContract",
name: "contracts::SchemaRegistry::ISchemaRegistry",
items: [
{
type: "function",
name: "gretting",
inputs: [],
outputs: [
name: "register",
inputs: [
{
name: "schema",
type: "core::byte_array::ByteArray",
},
],
state_mutability: "view",
},
{
type: "function",
name: "set_gretting",
inputs: [
{
name: "new_greeting",
type: "core::byte_array::ByteArray",
name: "revocable",
type: "core::bool",
},
],
outputs: [
{
name: "amount_eth",
type: "core::integer::u256",
type: "core::integer::u128",
},
],
outputs: [],
state_mutability: "external",
},
{
type: "function",
name: "withdraw",
inputs: [],
outputs: [],
state_mutability: "external",
},
{
type: "function",
name: "premium",
inputs: [],
name: "get_schema",
inputs: [
{
name: "uid",
type: "core::integer::u128",
},
],
outputs: [
{
type: "core::bool",
type: "(core::integer::u128, core::bool, core::byte_array::ByteArray)",
},
],
state_mutability: "view",
},
],
},
{
type: "impl",
name: "OwnableImpl",
interface_name: "openzeppelin::access::ownable::interface::IOwnable",
},
{
type: "interface",
name: "openzeppelin::access::ownable::interface::IOwnable",
items: [
type: "event",
name: "contracts::SchemaRegistry::SchemaRegistry::Registered",
kind: "struct",
members: [
{
type: "function",
name: "owner",
inputs: [],
outputs: [
{
type: "core::starknet::contract_address::ContractAddress",
},
],
state_mutability: "view",
name: "uid",
type: "core::integer::u128",
kind: "key",
},
{
type: "function",
name: "transfer_ownership",
inputs: [
{
name: "new_owner",
type: "core::starknet::contract_address::ContractAddress",
},
],
outputs: [],
state_mutability: "external",
name: "caller",
type: "core::starknet::contract_address::ContractAddress",
kind: "data",
},
{
type: "function",
name: "renounce_ownership",
inputs: [],
outputs: [],
state_mutability: "external",
name: "schema_record",
type: "core::byte_array::ByteArray",
kind: "data",
},
],
},
{
type: "constructor",
name: "constructor",
inputs: [
type: "event",
name: "contracts::SchemaRegistry::SchemaRegistry::Event",
kind: "enum",
variants: [
{
name: "owner",
type: "core::starknet::contract_address::ContractAddress",
name: "Registered",
type: "contracts::SchemaRegistry::SchemaRegistry::Registered",
kind: "nested",
},
],
},
],
},
},
sepolia: {
SchemaRegistry: {
abi: [
{
type: "event",
name: "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferred",
kind: "struct",
type: "impl",
name: "SchemaRegistryImpl",
interface_name: "contracts::SchemaRegistry::ISchemaRegistry",
},
{
type: "struct",
name: "core::byte_array::ByteArray",
members: [
{
name: "previous_owner",
type: "core::starknet::contract_address::ContractAddress",
kind: "key",
name: "data",
type: "core::array::Array::<core::bytes_31::bytes31>",
},
{
name: "new_owner",
type: "core::starknet::contract_address::ContractAddress",
kind: "key",
name: "pending_word",
type: "core::felt252",
},
{
name: "pending_word_len",
type: "core::integer::u32",
},
],
},
{
type: "event",
name: "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
kind: "struct",
members: [
type: "enum",
name: "core::bool",
variants: [
{
name: "previous_owner",
type: "core::starknet::contract_address::ContractAddress",
kind: "key",
name: "False",
type: "()",
},
{
name: "new_owner",
type: "core::starknet::contract_address::ContractAddress",
kind: "key",
name: "True",
type: "()",
},
],
},
{
type: "event",
name: "openzeppelin::access::ownable::ownable::OwnableComponent::Event",
kind: "enum",
variants: [
type: "interface",
name: "contracts::SchemaRegistry::ISchemaRegistry",
items: [
{
name: "OwnershipTransferred",
type: "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferred",
kind: "nested",
type: "function",
name: "register",
inputs: [
{
name: "schema",
type: "core::byte_array::ByteArray",
},
{
name: "revocable",
type: "core::bool",
},
],
outputs: [
{
type: "core::integer::u128",
},
],
state_mutability: "external",
},
{
name: "OwnershipTransferStarted",
type: "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
kind: "nested",
type: "function",
name: "get_schema",
inputs: [
{
name: "uid",
type: "core::integer::u128",
},
],
outputs: [
{
type: "(core::integer::u128, core::bool, core::byte_array::ByteArray)",
},
],
state_mutability: "view",
},
],
},
{
type: "event",
name: "contracts::YourContract::YourContract::GreetingChanged",
name: "contracts::SchemaRegistry::SchemaRegistry::Registered",
kind: "struct",
members: [
{
name: "greeting_setter",
type: "core::starknet::contract_address::ContractAddress",
kind: "key",
},
{
name: "new_greeting",
type: "core::byte_array::ByteArray",
name: "uid",
type: "core::integer::u128",
kind: "key",
},
{
name: "premium",
type: "core::bool",
name: "caller",
type: "core::starknet::contract_address::ContractAddress",
kind: "data",
},
{
name: "value",
type: "core::integer::u256",
name: "schema_record",
type: "core::byte_array::ByteArray",
kind: "data",
},
],
},
{
type: "event",
name: "contracts::YourContract::YourContract::Event",
name: "contracts::SchemaRegistry::SchemaRegistry::Event",
kind: "enum",
variants: [
{
name: "OwnableEvent",
type: "openzeppelin::access::ownable::ownable::OwnableComponent::Event",
kind: "flat",
},
{
name: "GreetingChanged",
type: "contracts::YourContract::YourContract::GreetingChanged",
name: "Registered",
type: "contracts::SchemaRegistry::SchemaRegistry::Registered",
kind: "nested",
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/scaffold.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type ScaffoldConfig = {
};

const scaffoldConfig = {
targetNetworks: [chains.devnet],
targetNetworks: [chains.sepolia],
// Only show the Burner Wallet when running on devnet
onlyLocalBurnerWallet: false,
rpcProviderUrl: process.env.NEXT_PUBLIC_PROVIDER_URL || "",
Expand Down
Loading

0 comments on commit 08fb539

Please sign in to comment.