Skip to content

Commit

Permalink
🚚 renamed project nft into carbonable project
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar committed Sep 1, 2022
1 parent e827dfc commit 2598850
Show file tree
Hide file tree
Showing 17 changed files with 272 additions and 287 deletions.
2 changes: 1 addition & 1 deletion src/interfaces/minter.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace ICarbonableMinter:
# @param vesting_id the vesting identifier
# @return the amount of releasable tokens
###
func project_nft_address() -> (project_nft_address : felt):
func carbonable_project_address() -> (carbonable_project_address : felt):
end
func payment_token_address() -> (payment_token_address : felt):
Expand Down
27 changes: 14 additions & 13 deletions src/mint/library.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ end
# Address of the project NFT contract
@storage_var
func project_nft_address_() -> (res : felt):
func carbonable_project_address_() -> (res : felt):
end
# Address of the project NFT contract
Expand Down Expand Up @@ -82,10 +82,11 @@ namespace CarbonableMinter:
# VIEWS
# -----
func project_nft_address{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
) -> (project_nft_address : felt):
let (project_nft_address) = project_nft_address_.read()
return (project_nft_address)
func carbonable_project_address{
syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr
}() -> (carbonable_project_address : felt):
let (carbonable_project_address) = carbonable_project_address_.read()
return (carbonable_project_address)
end

func payment_token_address{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
Expand Down Expand Up @@ -165,7 +166,7 @@ namespace CarbonableMinter:

func constructor{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
owner : felt,
project_nft_address : felt,
carbonable_project_address : felt,
payment_token_address : felt,
public_sale_open : felt,
max_buy_per_tx : felt,
Expand All @@ -174,7 +175,7 @@ namespace CarbonableMinter:
reserved_supply_for_mint : Uint256,
):
Ownable.initializer(owner)
project_nft_address_.write(project_nft_address)
carbonable_project_address_.write(carbonable_project_address)
payment_token_address_.write(payment_token_address)
public_sale_open_.write(public_sale_open)
max_buy_per_tx_.write(max_buy_per_tx)
Expand Down Expand Up @@ -260,10 +261,10 @@ namespace CarbonableMinter:
end
# Get storage variables
let (project_nft_address) = project_nft_address_.read()
let (carbonable_project_address) = carbonable_project_address_.read()
# Check if enough NFTs available
let (total_supply) = IERC721_Enumerable.totalSupply(project_nft_address)
let (total_supply) = IERC721_Enumerable.totalSupply(carbonable_project_address)
let (supply_after_buy) = SafeUint256.add(total_supply, quantity_uint256)
let (max_supply_for_mint) = max_supply_for_mint_.read()
let (enough_left) = uint256_le(supply_after_buy, max_supply_for_mint)
Expand All @@ -280,7 +281,7 @@ namespace CarbonableMinter:
# Do the actual NFT mint
let starting_index = total_supply
mint_n(project_nft_address, to, starting_index, quantity_uint256)
mint_n(carbonable_project_address, to, starting_index, quantity_uint256)
# Remove the minted quantity from the reserved supply
let (new_reserved_supply_for_mint) = SafeUint256.sub_le(
Expand Down Expand Up @@ -402,7 +403,7 @@ namespace CarbonableMinter:
end
# Get storage variables
let (project_nft_address) = project_nft_address_.read()
let (carbonable_project_address) = carbonable_project_address_.read()
let (unit_price) = unit_price_.read()
let (payment_token_address) = payment_token_address_.read()
let (max_buy_per_tx) = max_buy_per_tx_.read()
Expand All @@ -414,7 +415,7 @@ namespace CarbonableMinter:
end
# Check if enough NFTs available
let (total_supply) = IERC721_Enumerable.totalSupply(project_nft_address)
let (total_supply) = IERC721_Enumerable.totalSupply(carbonable_project_address)
let (supply_after_buy) = SafeUint256.add(total_supply, quantity_uint256)
let (max_supply_for_mint) = max_supply_for_mint_.read()
let (reserved_supply_for_mint) = reserved_supply_for_mint_.read()
Expand All @@ -439,7 +440,7 @@ namespace CarbonableMinter:
# Do the actual NFT mint
let starting_index = total_supply
mint_n(project_nft_address, caller, starting_index, quantity_uint256)
mint_n(carbonable_project_address, caller, starting_index, quantity_uint256)
# Success
return (TRUE)
end
Expand Down
11 changes: 5 additions & 6 deletions src/mint/minter.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ from src.mint.library import CarbonableMinter
# -----

@view
func project_nft_address{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}() -> (
project_nft_address : felt
):
return CarbonableMinter.project_nft_address()
func carbonable_project_address{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
) -> (carbonable_project_address : felt):
return CarbonableMinter.carbonable_project_address()
end

@view
Expand Down Expand Up @@ -93,7 +92,7 @@ end
@constructor
func constructor{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
owner : felt,
project_nft_address : felt,
carbonable_project_address : felt,
payment_token_address : felt,
public_sale_open : felt,
max_buy_per_tx : felt,
Expand All @@ -103,7 +102,7 @@ func constructor{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_p
):
return CarbonableMinter.constructor(
owner,
project_nft_address,
carbonable_project_address,
payment_token_address,
public_sale_open,
max_buy_per_tx,
Expand Down
15 changes: 8 additions & 7 deletions src/yield/library.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from openzeppelin.access.ownable import Ownable

# Address of the project NFT contract
@storage_var
func project_nft_address_() -> (res : felt):
func carbonable_project_address_() -> (res : felt):
end
# Address of the reward token contract
Expand All @@ -32,10 +32,11 @@ namespace YieldManager:
# VIEWS
# -----
func project_nft_address{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
) -> (project_nft_address : felt):
let (project_nft_address) = project_nft_address_.read()
return (project_nft_address)
func carbonable_project_address{
syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr
}() -> (carbonable_project_address : felt):
let (carbonable_project_address) = carbonable_project_address_.read()
return (carbonable_project_address)
end

func reward_token_address{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
Expand All @@ -56,12 +57,12 @@ namespace YieldManager:
# ------
func constructor{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
owner : felt,
project_nft_address : felt,
carbonable_project_address : felt,
carbonable_token_address : felt,
reward_token_address : felt,
):
Ownable.initializer(owner)
project_nft_address_.write(project_nft_address)
carbonable_project_address_.write(carbonable_project_address)
carbonable_token_address_.write(carbonable_token_address)
reward_token_address_.write(reward_token_address)
return ()
Expand Down
10 changes: 5 additions & 5 deletions src/yield/yield_manager.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ from src.yield.library import YieldManager
# -----

@view
func project_nft_address{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}() -> (
project_nft_address : felt
func carbonable_project_address{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}() -> (
carbonable_project_address : felt
):
return YieldManager.project_nft_address()
return YieldManager.carbonable_project_address()
end

@view
Expand All @@ -37,11 +37,11 @@ end
@constructor
func constructor{syscall_ptr : felt*, pedersen_ptr : HashBuiltin*, range_check_ptr}(
owner : felt,
project_nft_address : felt,
carbonable_project_address : felt,
carbonable_token_address : felt,
reward_token_address : felt,
):
return YieldManager.constructor(
owner, project_nft_address, carbonable_token_address, reward_token_address
owner, carbonable_project_address, carbonable_token_address, reward_token_address
)
end
Loading

0 comments on commit 2598850

Please sign in to comment.