Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deployer preset #467

Merged
merged 23 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add calldata to event log
  • Loading branch information
martriay committed Oct 7, 2022
commit acb85f2311ac7ec92c4e2d989e7064c42397cbae
7 changes: 6 additions & 1 deletion src/openzeppelin/utils/presets/UniversalDeployer.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ func ContractDeployed(
address: felt,
deployer: felt,
classHash: felt,
calldata_len: felt,
calldata: felt*,
salt: felt
martriay marked this conversation as resolved.
Show resolved Hide resolved
) {
}
Expand All @@ -29,6 +31,7 @@ func deployContract{
calldata_len: felt,
calldata: felt*
) -> (address: felt) {
alloc_locals;
let (deployer) = get_caller_address();

tempvar prefix;
Expand All @@ -43,7 +46,7 @@ func deployContract{

let (_salt) = hash2{hash_ptr=pedersen_ptr}(prefix, salt);

let (address) = deploy(
let (local address) = deploy(
martriay marked this conversation as resolved.
Show resolved Hide resolved
class_hash=classHash,
contract_address_salt=_salt,
constructor_calldata_size=calldata_len,
Expand All @@ -55,6 +58,8 @@ func deployContract{
address=address,
deployer=deployer,
classHash=classHash,
calldata_len=calldata_len,
calldata=calldata,
martriay marked this conversation as resolved.
Show resolved Hide resolved
salt=_salt
);

Expand Down
2 changes: 2 additions & 0 deletions tests/utils/test_UniversalDeployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ async def test_deployment(deployer_factory, unique):
deployed_address, # contractAddress
account.contract_address, # deployer
class_hash, # classHash
len(calldata), # calldata_len
calldata, # calldata
actual_salt, # salt
]
)