Skip to content

Commit

Permalink
read class_hash in var
Browse files Browse the repository at this point in the history
gaetbout committed Jun 6, 2024
1 parent 5cd716e commit 5e209f5
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/contracts/gift_factory.cairo
Original file line number Diff line number Diff line change
@@ -107,9 +107,10 @@ mod GiftFactory {
let sender = get_caller_address();
let factory = get_contract_address();
// TODO We could manually serialize for better performance
let class_hash = self.claim_class_hash.read();
let constructor_arguments = AccountConstructorArguments { sender, amount, max_fee, token, claim_pubkey };
let (claim_contract, _) = deploy_syscall(
self.claim_class_hash.read(), // class_hash
class_hash, // class_hash
0, // salt
serialize(@constructor_arguments).span(), // constructor data
false // deploy_from_zero
@@ -118,14 +119,7 @@ mod GiftFactory {
self
.emit(
GiftCreated {
claim_pubkey,
factory,
gift_address: claim_contract,
class_hash: self.claim_class_hash.read(),
sender,
amount,
max_fee,
token,
claim_pubkey, factory, gift_address: claim_contract, class_hash, sender, amount, max_fee, token,
}
);
let transfer_status = IERC20Dispatcher { contract_address: token }

0 comments on commit 5e209f5

Please sign in to comment.