From c74d6f17ccf829468813299a37a2fc9b0cc327e2 Mon Sep 17 00:00:00 2001 From: julienbrs Date: Fri, 28 Jun 2024 11:36:47 +0200 Subject: [PATCH 01/18] init-config contributors bot --- .all-contributorsrc | 10 ++++++++++ README.md | 1 + 2 files changed, 11 insertions(+) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..749b233 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,10 @@ +{ + "projectName": "carbon-protocol-v3", + "projectOwner": "carbonable-labs", + "repoType": "github", + "repoHost": "https://github.com", + "files": ["README.md"], + "imageSize": 100, + "commit": true, + "commitConvention": "gitmoji" +} \ No newline at end of file diff --git a/README.md b/README.md index 30f6f6f..aa825c7 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ ## About + Carbon Protocol V3 is a cutting-edge, open-source tool designed for the tokenization, trading, and management of carbon credits on Starknet. From 2cefa9c5e505008883f187c32b0a7080ddeacef0 Mon Sep 17 00:00:00 2001 From: julienbrs Date: Fri, 28 Jun 2024 11:36:47 +0200 Subject: [PATCH 02/18] init-config contributors bot --- .all-contributorsrc | 10 ++++++++++ README.md | 1 + 2 files changed, 11 insertions(+) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..749b233 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,10 @@ +{ + "projectName": "carbon-protocol-v3", + "projectOwner": "carbonable-labs", + "repoType": "github", + "repoHost": "https://github.com", + "files": ["README.md"], + "imageSize": 100, + "commit": true, + "commitConvention": "gitmoji" +} \ No newline at end of file diff --git a/README.md b/README.md index 30f6f6f..aa825c7 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ ## About + Carbon Protocol V3 is a cutting-edge, open-source tool designed for the tokenization, trading, and management of carbon credits on Starknet. From fa7ecbd4659eec7305bd56bb83ee8ade5fe4956a Mon Sep 17 00:00:00 2001 From: julienbrs Date: Fri, 28 Jun 2024 12:23:16 +0200 Subject: [PATCH 03/18] remove file --- .all-contributorsrc | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc deleted file mode 100644 index 749b233..0000000 --- a/.all-contributorsrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "projectName": "carbon-protocol-v3", - "projectOwner": "carbonable-labs", - "repoType": "github", - "repoHost": "https://github.com", - "files": ["README.md"], - "imageSize": 100, - "commit": true, - "commitConvention": "gitmoji" -} \ No newline at end of file From 6292654d03e59cd6db47aac3ee02ca7cad756938 Mon Sep 17 00:00:00 2001 From: julienbrs Date: Fri, 28 Jun 2024 12:46:15 +0200 Subject: [PATCH 04/18] revert setup --- .all-contributorsrc | 10 ---------- README.md | 1 - 2 files changed, 11 deletions(-) delete mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc deleted file mode 100644 index 749b233..0000000 --- a/.all-contributorsrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "projectName": "carbon-protocol-v3", - "projectOwner": "carbonable-labs", - "repoType": "github", - "repoHost": "https://github.com", - "files": ["README.md"], - "imageSize": 100, - "commit": true, - "commitConvention": "gitmoji" -} \ No newline at end of file diff --git a/README.md b/README.md index aa825c7..30f6f6f 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ ## About - Carbon Protocol V3 is a cutting-edge, open-source tool designed for the tokenization, trading, and management of carbon credits on Starknet. From dd794d9e207ffccbe9831ac29b73a2058b5ad94e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:55:44 +0000 Subject: [PATCH 05/18] docs: update README.md [skip ci] --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 30f6f6f..4bfeef5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@
+ +[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) +

Carbon Protocol V3 on Starknet

Leading Web3 Infrastructure to Manage Real-World Assets (RWA)

@@ -71,6 +74,21 @@ This project is licensed under the **Apache License, Version 2.0**. See [LICENSE ## Contributors ✨ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + + +
Ainur
Ainur

💻
+ + + + + From e1419606fbdd46845450f5cc25c6e1c4520e16bc Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:55:45 +0000 Subject: [PATCH 06/18] docs: create .all-contributorsrc [skip ci] --- .all-contributorsrc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..59f7fb0 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,26 @@ +{ + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": false, + "commitType": "docs", + "commitConvention": "angular", + "contributors": [ + { + "login": "julienbrs", + "name": "Ainur", + "avatar_url": "https://avatars.githubusercontent.com/u/106234742?v=4", + "profile": "https://github.com/julienbrs", + "contributions": [ + "code" + ] + } + ], + "contributorsPerLine": 7, + "skipCi": true, + "repoType": "github", + "repoHost": "https://github.com", + "projectName": "carbon-protocol-v3", + "projectOwner": "carbonable-labs" +} From 54b7172eeacb0a8f2cf26a9a795ed57167d3e96c Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:01:21 +0000 Subject: [PATCH 07/18] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bfeef5..9f563e5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)

Carbon Protocol V3 on Starknet

Leading Web3 Infrastructure to Manage Real-World Assets (RWA)

@@ -81,6 +81,7 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc Ainur
Ainur

💻 + Wolf
Wolf

🐛 From c78f95f42e0f1be98cfa3be046f98855487ad7ca Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:01:22 +0000 Subject: [PATCH 08/18] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 59f7fb0..6898086 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -15,6 +15,15 @@ "contributions": [ "code" ] + }, + { + "login": "raizo07", + "name": "Wolf", + "avatar_url": "https://avatars.githubusercontent.com/u/81079370?v=4", + "profile": "https://github.com/raizo07", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, From 25dbb2d38a243714809cb383bc157e09e27da6ef Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:07:22 +0000 Subject: [PATCH 09/18] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f563e5..66d23dc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)

Carbon Protocol V3 on Starknet

Leading Web3 Infrastructure to Manage Real-World Assets (RWA)

@@ -82,6 +82,7 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc Ainur
Ainur

💻 Wolf
Wolf

🐛 + Trunks @ Carbonable
Trunks @ Carbonable

💻 From 52c078c2e6576cafd1d4df776f368f2d7643863a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:07:23 +0000 Subject: [PATCH 10/18] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 6898086..7276bac 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -24,6 +24,15 @@ "contributions": [ "bug" ] + }, + { + "login": "tekkac", + "name": "Trunks @ Carbonable", + "avatar_url": "https://avatars.githubusercontent.com/u/98529704?v=4", + "profile": "https://github.com/tekkac", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, From 6d33995b42a7fd5741803714a0f9c940736bb24b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:15:14 +0000 Subject: [PATCH 11/18] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 66d23dc..67a9798 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)

Carbon Protocol V3 on Starknet

Leading Web3 Infrastructure to Manage Real-World Assets (RWA)

@@ -83,6 +83,7 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc Ainur
Ainur

💻 Wolf
Wolf

🐛 Trunks @ Carbonable
Trunks @ Carbonable

💻 + bitfalt
bitfalt

💻 From 7a37d168ff8455858d3db89928fb0ab32818a7a0 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:15:24 +0000 Subject: [PATCH 12/18] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7276bac..1be218e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -33,6 +33,15 @@ "contributions": [ "code" ] + }, + { + "login": "bitfalt", + "name": "bitfalt", + "avatar_url": "https://avatars.githubusercontent.com/u/75431447?v=4", + "profile": "https://github.com/bitfalt", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, From 3b876801f5f769de4bc1d49b55b957cda7f90adf Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:31:40 +0200 Subject: [PATCH 13/18] docs: add shivam6862 as a contributor for code (#98) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Ainur <106234742+julienbrs@users.noreply.github.com> --- .all-contributorsrc | 17 +++++++++++++---- README.md | 4 +--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 1be218e..346fc07 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -35,10 +35,19 @@ ] }, { - "login": "bitfalt", - "name": "bitfalt", - "avatar_url": "https://avatars.githubusercontent.com/u/75431447?v=4", - "profile": "https://github.com/bitfalt", + "login": "shivam6862", + "name": "Shivam kumar", + "avatar_url": "https://avatars.githubusercontent.com/u/115404926?v=4", + "profile": "https://shivam6862.github.io/", + "contributions": [ + "code" + ] + }, + { + "login": "shivam6862", + "name": "Shivam kumar", + "avatar_url": "https://avatars.githubusercontent.com/u/115404926?v=4", + "profile": "https://shivam6862.github.io/", "contributions": [ "code" ] diff --git a/README.md b/README.md index 67a9798..1b8884b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,4 @@
- -[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-) -

Carbon Protocol V3 on Starknet

Leading Web3 Infrastructure to Manage Real-World Assets (RWA)

@@ -83,6 +80,7 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc Ainur
Ainur

💻 Wolf
Wolf

🐛 Trunks @ Carbonable
Trunks @ Carbonable

💻 + Shivam kumar
Shivam kumar

💻 bitfalt
bitfalt

💻 From 6a82d56caffe579a40229709d1b0404c5f306318 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:35:44 +0200 Subject: [PATCH 14/18] docs: add thomas192 as a contributor for code (#100) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Ainur <106234742+julienbrs@users.noreply.github.com> --- .all-contributorsrc | 10 +++++----- README.md | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 346fc07..f5b450e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -35,10 +35,10 @@ ] }, { - "login": "shivam6862", - "name": "Shivam kumar", - "avatar_url": "https://avatars.githubusercontent.com/u/115404926?v=4", - "profile": "https://shivam6862.github.io/", + "login": "thomas192", + "name": "0xK2", + "avatar_url": "https://avatars.githubusercontent.com/u/65908739?v=4", + "profile": "https://github.com/thomas192", "contributions": [ "code" ] @@ -51,7 +51,7 @@ "contributions": [ "code" ] - } + } ], "contributorsPerLine": 7, "skipCi": true, diff --git a/README.md b/README.md index 1b8884b..92c585b 100644 --- a/README.md +++ b/README.md @@ -78,10 +78,11 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc Ainur
Ainur

💻 - Wolf
Wolf

🐛 Trunks @ Carbonable
Trunks @ Carbonable

💻 - Shivam kumar
Shivam kumar

💻 bitfalt
bitfalt

💻 + 0xK2
0xK2

💻 + Shivam kumar
Shivam kumar

💻 + Wolf
Wolf

🐛 From 2c8be044306064a7a698a65a09330801345c2497 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:31:59 +0200 Subject: [PATCH 15/18] docs: add adrianvrj as a contributor for code (#99) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Ainur <106234742+julienbrs@users.noreply.github.com> --- .all-contributorsrc | 20 +++++++++++++++++++- README.md | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index f5b450e..a5c0ed5 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -34,6 +34,24 @@ "code" ] }, + { + "login": "tekkac", + "name": "Trunks @ Carbonable", + "avatar_url": "https://avatars.githubusercontent.com/u/98529704?v=4", + "profile": "https://github.com/tekkac", + "contributions": [ + "code" + ] + }, + { + "login": "adrianvrj", + "name": "ADR!AN", + "avatar_url": "https://avatars.githubusercontent.com/u/111903096?v=4", + "profile": "https://github.com/adrianvrj", + "contributions": [ + "code" + ] + }, { "login": "thomas192", "name": "0xK2", @@ -51,7 +69,7 @@ "contributions": [ "code" ] - } + } ], "contributorsPerLine": 7, "skipCi": true, diff --git a/README.md b/README.md index 92c585b..1095138 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc bitfalt
bitfalt

💻 0xK2
0xK2

💻 Shivam kumar
Shivam kumar

💻 + ADR!AN
ADR!AN

💻 Wolf
Wolf

🐛 From a2cf5c90c6d6bdba2e485e67679e2ee8309cc45a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:06:43 +0200 Subject: [PATCH 16/18] docs: add axelizsak as a contributor for code (#96) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Ainur <106234742+julienbrs@users.noreply.github.com> --- .all-contributorsrc | 8 ++++---- README.md | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index a5c0ed5..52799ae 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -26,10 +26,10 @@ ] }, { - "login": "tekkac", - "name": "Trunks @ Carbonable", - "avatar_url": "https://avatars.githubusercontent.com/u/98529704?v=4", - "profile": "https://github.com/tekkac", + "login": "axelizsak", + "name": "Axel Izsak", + "avatar_url": "https://avatars.githubusercontent.com/u/98711930?v=4", + "profile": "https://github.com/axelizsak", "contributions": [ "code" ] diff --git a/README.md b/README.md index 1095138..df0fc5a 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,9 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc 0xK2
0xK2

💻 Shivam kumar
Shivam kumar

💻 ADR!AN
ADR!AN

💻 + Axel Izsak
Axel Izsak

💻 + + Wolf
Wolf

🐛 From 5d821a8ed71e9ef0cebe7fb34c8f1911db9ce446 Mon Sep 17 00:00:00 2001 From: Emmanuel Soetan Date: Fri, 28 Jun 2024 15:45:12 +0100 Subject: [PATCH 17/18] Additional unit tests for project.cairo * [test]:unit test project.cairo * implemented requested changes and finished test * scarb fmt * remove comments --------- Co-authored-by: julienbrs --- src/contracts/project.cairo | 6 +++ tests/test_project.cairo | 80 +++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/src/contracts/project.cairo b/src/contracts/project.cairo index 48c3de0..87fa732 100644 --- a/src/contracts/project.cairo +++ b/src/contracts/project.cairo @@ -11,6 +11,7 @@ trait IExternal { ref self: ContractState, from: ContractAddress, token_ids: Span, values: Span ); fn set_uri(ref self: ContractState, uri: ByteArray); + fn get_uri(self: @ContractState, token_id: u256) -> ByteArray; fn decimals(self: @ContractState) -> u8; fn only_owner(self: @ContractState, caller_address: ContractAddress) -> bool; fn grant_minter_role(ref self: ContractState, minter: ContractAddress); @@ -216,6 +217,11 @@ mod Project { self.erc1155.set_base_uri(uri); } + fn get_uri(self: @ContractState, token_id: u256) -> ByteArray { + let uri_result: ByteArray = self.erc1155.uri(token_id); + uri_result + } + fn decimals(self: @ContractState) -> u8 { self.absorber.get_cc_decimals() } diff --git a/tests/test_project.cairo b/tests/test_project.cairo index d268d54..fa48bc5 100644 --- a/tests/test_project.cairo +++ b/tests/test_project.cairo @@ -1,6 +1,7 @@ // Starknet deps use starknet::{ContractAddress, contract_address_const}; +use starknet::get_caller_address; // External deps @@ -22,6 +23,7 @@ use carbon_v3::components::absorber::interface::{ }; use carbon_v3::components::absorber::carbon_handler::AbsorberComponent::CC_DECIMALS_MULTIPLIER; use carbon_v3::components::minter::interface::{IMint, IMintDispatcher, IMintDispatcherTrait}; +//use carbon_v3::components::metadata::{IMetadataHandler, IMetadataHandlerDispatcher, IMetadataHandlerDispatcherTrait}; // Contracts @@ -30,6 +32,7 @@ use carbon_v3::contracts::project::{ IExternalDispatcherTrait as IProjectDispatcherTrait }; + /// Utils for testing purposes /// use super::tests_lib::{ @@ -440,6 +443,7 @@ fn test_project_balance_of() { assert(equals_with_error(balance, expected_balance, 10), 'Error of balance'); } + #[test] fn test_transfer_without_loss() { let owner_address: ContractAddress = contract_address_const::<'OWNER'>(); @@ -722,3 +726,79 @@ fn fuzz_test_transfer_high_supply_high_amount( max_supply_for_vintage ); } + +#[test] +fn test_set_uri() { + let owner_address: ContractAddress = contract_address_const::<'OWNER'>(); + let (project_address, _) = default_setup_and_deploy(); + let project_contract = IProjectDispatcher { contract_address: project_address }; + let absorber = IAbsorberDispatcher { contract_address: project_address }; + start_prank(CheatTarget::One(project_address), owner_address); + assert(absorber.is_setup(), 'Error during setup'); + project_contract.set_uri("test_uri"); + let uri = project_contract.get_uri(1); + assert_eq!(uri, "test_uri"); +} + +#[test] +fn test_decimals() { + let (project_address, _) = default_setup_and_deploy(); + let project_contract = IProjectDispatcher { contract_address: project_address }; + let absorber = IAbsorberDispatcher { contract_address: project_address }; + + assert(absorber.is_setup(), 'Error during setup'); + + let project_decimals = project_contract.decimals(); + + assert(project_decimals == 8, 'Decimals should be 8'); +} + +#[test] +fn test_shares_of() { + let (project_address, _) = default_setup_and_deploy(); + let project_contract = IProjectDispatcher { contract_address: project_address }; + let absorber = IAbsorberDispatcher { contract_address: project_address }; + + assert(absorber.is_setup(), 'Error during setup'); + + let share_balance = project_contract.shares_of(project_address, 2025); + + assert(share_balance == 0, 'Shares Balance is wrong'); +} + +#[test] +fn test_is_approved_for_all() { + let (project_address, _) = default_setup_and_deploy(); + let project_contract = IProjectDispatcher { contract_address: project_address }; + let absorber = IAbsorberDispatcher { contract_address: project_address }; + + assert(absorber.is_setup(), 'Error during setup'); + + let owner = get_caller_address(); + + let status = project_contract.is_approved_for_all(owner, project_address); + // Check if status of approval is a boolean + assert!(status == true || status == false, "Expected a boolean value"); +} + +#[test] +fn test_set_approval_for_all() { + let owner_address: ContractAddress = contract_address_const::<'OWNER'>(); + let (project_address, _) = default_setup_and_deploy(); + let project_contract = IProjectDispatcher { contract_address: project_address }; + let absorber = IAbsorberDispatcher { contract_address: project_address }; + + start_prank(CheatTarget::One(project_address), owner_address); + + assert(absorber.is_setup(), 'Error during setup'); + + let owner = get_caller_address(); + + let approval: bool = false; + + project_contract.set_approval_for_all(project_address, approval); + + let status_now = project_contract.is_approved_for_all(owner, project_address); + + assert_eq!(status_now, false); +} From a95fbfc8d024247e3eec86a0e080c36a3bb2b881 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:01:29 +0200 Subject: [PATCH 18/18] docs: add Shoetan as a contributor for code (#102) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] * fix: contributors --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: julienbrs --- .all-contributorsrc | 44 +++++++++++++++++++++++++++++++------------- README.md | 15 +++------------ 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 52799ae..61607de 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -17,28 +17,28 @@ ] }, { - "login": "raizo07", - "name": "Wolf", - "avatar_url": "https://avatars.githubusercontent.com/u/81079370?v=4", - "profile": "https://github.com/raizo07", + "login": "tekkac", + "name": "Trunks @ Carbonable", + "avatar_url": "https://avatars.githubusercontent.com/u/98529704?v=4", + "profile": "https://github.com/tekkac", "contributions": [ - "bug" + "code" ] }, { - "login": "axelizsak", - "name": "Axel Izsak", - "avatar_url": "https://avatars.githubusercontent.com/u/98711930?v=4", - "profile": "https://github.com/axelizsak", + "login": "bitfalt", + "name": "bitfalt", + "avatar_url": "https://avatars.githubusercontent.com/u/75431447?v=4", + "profile": "https://github.com/bitfalt", "contributions": [ "code" ] }, { - "login": "tekkac", - "name": "Trunks @ Carbonable", - "avatar_url": "https://avatars.githubusercontent.com/u/98529704?v=4", - "profile": "https://github.com/tekkac", + "login": "axelizsak", + "name": "Axel Izsak", + "avatar_url": "https://avatars.githubusercontent.com/u/98711930?v=4", + "profile": "https://github.com/axelizsak", "contributions": [ "code" ] @@ -69,6 +69,24 @@ "contributions": [ "code" ] + }, + { + "login": "raizo07", + "name": "Wolf", + "avatar_url": "https://avatars.githubusercontent.com/u/81079370?v=4", + "profile": "https://github.com/raizo07", + "contributions": [ + "bug" + ] + }, + { + "login": "Shoetan", + "name": "Emmanuel Soetan", + "avatar_url": "https://avatars.githubusercontent.com/u/17912134?v=4", + "profile": "https://soetandev.netlify.app/", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index df0fc5a..0d2d79d 100644 --- a/README.md +++ b/README.md @@ -80,27 +80,18 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc Ainur
Ainur

💻 Trunks @ Carbonable
Trunks @ Carbonable

💻 bitfalt
bitfalt

💻 + Axel Izsak
Axel Izsak

💻 + ADR!AN
ADR!AN

💻 0xK2
0xK2

💻 Shivam kumar
Shivam kumar

💻 - ADR!AN
ADR!AN

💻 - Axel Izsak
Axel Izsak

💻 Wolf
Wolf

🐛 + Emmanuel Soetan
Emmanuel Soetan

💻 - - - - - - - - - -