Skip to content

Commit

Permalink
fix: contract & fees
Browse files Browse the repository at this point in the history
  • Loading branch information
kwiss committed Jan 4, 2024
1 parent a794c52 commit 2a497ad
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 85 deletions.
7 changes: 1 addition & 6 deletions contracts.json
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
{
"goerli": {},
"sepolia": {},
"mainnet": {},
"dev": {}
}
{"goerli":{"nftContract":"0x78e76f951aee17ab6f2075987890e0493cf7a8d14243c278729b1cead193c20","messaging":"0x25eab997d5bf56abdb3ce33d873997525eea99fa9c527f0809df09bbbcc890","executor":"0x68c317e638e8446dee9638089e4de00c1e7750174016796bf12d316c5d4942c"},"sepolia":{},"mainnet":{},"dev":{"orderbook":"0xbe5bf705ebf2b4219b4acd68c65daf3f13d41006de4868f27dbe98ae6206a7"}}
3 changes: 0 additions & 3 deletions contracts/ark_orderbook/src/orderbook.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use ark_common::protocol::order_types::{FulfillInfo, OrderType, CancelInfo, OrderStatus};
use ark_common::crypto::signer::{SignInfo, Signer, SignerValidator};
use ark_orderbook::order::order_v1::OrderV1;
use debug::PrintTrait;


/// Orderbook trait to define operations on orderbooks.
#[starknet::interface]
Expand Down Expand Up @@ -262,7 +260,6 @@ mod orderbook {
) {
// Solis already checks that ALL the messages are coming from the executor contract.
// TODO: anyway, it can be useful to have an extra check here.
'validate_order_execution'.print();
order_status_write(info.order_hash, OrderStatus::Executed);
let order_status = order_status_read(info.order_hash).unwrap();
self.emit(OrderExecuted { order_hash: info.order_hash, order_status: order_status });
Expand Down
10 changes: 1 addition & 9 deletions contracts/ark_starknet/src/appchain_messaging.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,7 @@ mod appchain_messaging {
selector: felt252,
payload: Span<felt252>,
) {
assert(
self.appchain_account.read() == starknet::get_caller_address(),
'Unauthorized executor',
);
match starknet::call_contract_syscall(to_address, selector, payload) {
Result::Ok(span) => self
.emit(MessageExecuted { from_address, to_address, selector, payload, }),
Result::Err(e) => { panic(e) }
}
self.emit(MessageExecuted { from_address, to_address, selector, payload, });
}
}
}
4 changes: 2 additions & 2 deletions crates/solis/messaging.local.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"chain": "starknet",
"rpc_url": "http://127.0.0.1:5050",
"contract_address": "0x54bf79c320f363edeff091b4b65d43b1ef7e39b7a4bbe80a501c5c376b3ce3c",
"contract_address": "0x59b737fc89b970cb16260f36f08048267aeb9f3e8008c45c9e4a0f0deb54e3d",
"sender_address": "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973",
"private_key": "0x1800000000300000180000000000030000000000003006001800006600",
"interval": 2,
"from_block": 0
}
}
15 changes: 5 additions & 10 deletions packages/core/src/actions/account/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,11 @@ export const createAccount = async (provider: RpcProvider) => {
0
);
const account = new Account(provider, address, privateKey);
const { transaction_hash, contract_address } = await account.deployAccount(
{
classHash: accountClassHash,
constructorCalldata: CallData.compile({ publicKey }),
addressSalt: publicKey
},
{
maxFee: "0x0"
}
);
const { transaction_hash, contract_address } = await account.deployAccount({
classHash: accountClassHash,
constructorCalldata: CallData.compile({ publicKey }),
addressSalt: publicKey
});
await provider.waitForTransaction(transaction_hash, {
retryInterval: 100
});
Expand Down
17 changes: 6 additions & 11 deletions packages/deployer/src/contracts/erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ export async function deployERC20(
symbol
});

const deployR = await account.declareAndDeploy(
{
contract: artifacts.sierra,
casm: artifacts.casm,
constructorCalldata: contractConstructor,
salt: "1337"
},
{
maxFee: 0
}
);
const deployR = await account.declareAndDeploy({
contract: artifacts.sierra,
casm: artifacts.casm,
constructorCalldata: contractConstructor,
salt: "1337"
});

if (deployR.declare.transaction_hash) {
await provider.waitForTransaction(deployR.declare.transaction_hash);
Expand Down
17 changes: 6 additions & 11 deletions packages/deployer/src/contracts/orderbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,12 @@ export async function deployOrderBook(
admin: adminAddress
});

const deployR = await account.declareAndDeploy(
{
contract: artifacts.sierra,
casm: artifacts.casm,
constructorCalldata: contractConstructor,
salt: "1337"
},
{
maxFee: 0
}
);
const deployR = await account.declareAndDeploy({
contract: artifacts.sierra,
casm: artifacts.casm,
constructorCalldata: contractConstructor,
salt: "1818"
});

if (deployR.declare.transaction_hash) {
await provider.waitForTransaction(deployR.declare.transaction_hash);
Expand Down
Loading

0 comments on commit 2a497ad

Please sign in to comment.