Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions cairo/crates/contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ casm = true
casm-add-pythonic-hints = true
build-external-contracts = ["mocks::*"]

[scripts]
starknet = "FEE_TOKEN=0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d ./feeToken.sh"
paradex = "FEE_TOKEN=0x7348407ebad690fec0cc8597e87dc16ef7b269a655ff72587dafff83d462be2 ./feeToken.sh"

[lib]
name = "contracts"
16 changes: 16 additions & 0 deletions cairo/crates/contracts/feeToken.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

FILEPATH="src/fee_token.cairo"
TEMPFILE=$(mktemp)

# writes all but the last 2 lines to the temp file
head -n $(($(wc -l < $FILEPATH) - 2)) $FILEPATH > $TEMPFILE

# writes generated last 2 lines to the temp file
cat <<EOF >> $TEMPFILE
$FEE_TOKEN.try_into().unwrap()
}
EOF

# overwrite the original file with the temp file
cat $TEMPFILE > $FILEPATH
6 changes: 6 additions & 0 deletions cairo/crates/contracts/src/fee_token.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use starknet::ContractAddress;

pub fn FEE_TOKEN() -> ContractAddress {
// GENERATED CODE - DO NOT EDIT
0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d.try_into().unwrap()
}
3 changes: 2 additions & 1 deletion cairo/crates/contracts/src/interfaces.cairo
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use alexandria_bytes::Bytes;
use contracts::fee_token::FEE_TOKEN;
use contracts::hooks::merkle_tree_hook::merkle_tree_hook::Tree;
use contracts::libs::message::Message;
use core::array::ArrayTrait;
use starknet::ContractAddress;
use starknet::EthAddress;

pub fn ETH_ADDRESS() -> ContractAddress {
0x049D36570D4e46f48e99674bd3fcc84644DdD6b96F7C741B1562B82f9e004dC7.try_into().unwrap()
FEE_TOKEN()
}

#[derive(Serde, Drop, Debug, PartialEq)]
Expand Down
1 change: 1 addition & 0 deletions cairo/crates/contracts/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod fee_token;
pub mod interfaces;
pub mod mailbox;
pub mod libs {
Expand Down
Loading