Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 15 additions & 13 deletions .env.stencil
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
WALLETCONNECT_PROJECT_ID=<WALLETCONNECT_PROJECT_ID>
API_KEY=<PINATA_API_KEY>
API_SECRET=<PINATA_API_SECRET>
ALCHEMY_API_KEY=<ALCHEMY_API_KEY>
CONTRACT_ADDRESS=<CONTRACT_ADDRESS>
APPLICATION_ID=<APPLICATION_ID>
#API KEYS AND SECRETS

API_KEY=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear anymore that this is from Pinata.

API_SECRET=
ALCHEMY_API_KEY=

//CONTRACT ADDRESSES
#APPLICATION CONFIGURATION

APPLICATION_CHAIN_ID=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that Treee is currently made to work with a single blockchain.

We should generalize it to be multi-chain, so that the user can choose on which blockchain he/she wants to register his/her trees.

WALLETCONNECT_PROJECT_ID=

TREE_NFT_CONTRACT_ADDRESS=<TREE_NFT_CONTRACT_ADDRESS>
ORGANISATION_FACTORY_CONTRACT_ADDRESS=<ORGANISATION_FACTORY_CONTRACT_ADDRESS>
CARE_TOKEN_CONTRACT_ADDRESS=<CARE_TOKEN_CONTRACT_ADDRESS>
VERIFIER_TOKEN_CONTRACT_ADDRESS=<VERIFIER_TOKEN_CONTRACT_ADDRESS>
LEGACY_TOKEN_CONTRACT_ADDRESS=<LEGACY_TOKEN_CONTRACT_ADDRESS>
PLANTER_TOKEN_CONTRACT_ADDRESS=<PLANTER_TOKEN_CONTRACT_ADDRESS>
#CONTRACT ADDRESSES

TREE_NFT_CONTRACT_ADDRESS=
ORGANISATION_FACTORY_CONTRACT_ADDRESS=
CARE_TOKEN_CONTRACT_ADDRESS=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there just one care/verifier/legacy/planter token contract for everyone?

If so, people could easily cheat to get more tokens.

I thought each verifier would be able to mint its own set of tokens.

For example, if I want to act as a verifier, I would launch my own planter token, which I can then mint and give to users who planted the trees that I have verified.

VERIFIER_TOKEN_CONTRACT_ADDRESS=
LEGACY_TOKEN_CONTRACT_ADDRESS=
PLANTER_TOKEN_CONTRACT_ADDRESS=
27 changes: 27 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import 'package:tree_planting_protocol/pages/home_page.dart';
import 'package:tree_planting_protocol/pages/mint_nft/mint_nft_details.dart';
import 'package:tree_planting_protocol/pages/mint_nft/mint_nft_images.dart';
import 'package:tree_planting_protocol/pages/mint_nft/submit_nft_page.dart';
import 'package:tree_planting_protocol/pages/organisations_pages/create_organisation.dart';
import 'package:tree_planting_protocol/pages/organisations_pages/organisation_details_page.dart';
import 'package:tree_planting_protocol/pages/organisations_pages/user_organisations_page.dart';
import 'package:tree_planting_protocol/pages/register_user_page.dart';
import 'package:tree_planting_protocol/pages/settings_page.dart';
import 'package:tree_planting_protocol/pages/tree_details_page.dart';
Expand Down Expand Up @@ -63,6 +66,30 @@ class MyApp extends StatelessWidget {
return const SettingsPage();
},
),
GoRoute(
path: '/organisations',
name: 'organisations_page',
builder: (BuildContext context, GoRouterState state) {
return const OrganisationsPage();
},
routes: [
GoRoute(
path: ':address',
name: 'organisation_details',
builder: (BuildContext context, GoRouterState state) {
final address = state.pathParameters['address'];
return OrganisationDetailsPage(organisationAddress: address!);
},
),
],
),
GoRoute(
path: '/create-organisation',
name: 'create_organisation_page',
builder: (BuildContext context, GoRouterState state) {
return const CreateOrganisationPage();
},
),
GoRoute(
path: RouteConstants.mintNftPath,
name: RouteConstants.mintNft,
Expand Down
39 changes: 0 additions & 39 deletions lib/pages/mint_nft/mint_nft_coordinates.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:tree_planting_protocol/utils/constants/ui/color_constants.dart';
import 'package:tree_planting_protocol/utils/logger.dart';
import 'package:tree_planting_protocol/widgets/basic_scaffold.dart';
import 'package:tree_planting_protocol/widgets/map_widgets/flutter_map_widget.dart';
import 'package:tree_planting_protocol/widgets/nft_display_utils/tree_nft_view_widget.dart';
import 'package:tree_planting_protocol/utils/services/get_current_location.dart';
import 'package:dart_geohash/dart_geohash.dart';

Expand Down Expand Up @@ -606,44 +605,6 @@ class _MintNftCoordinatesPageState extends State<MintNftCoordinatesPage> {
);
}

// ignore: unused_element
Widget _buildPreviewSection() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: const Color(0xFFFAEB96),
borderRadius: BorderRadius.circular(10),
),
child: Icon(
Icons.preview,
color: const Color(0xFF1CD381),
size: 20,
),
),
const SizedBox(width: 12),
const Text(
'Live Preview',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Color(0xFF1CD381),
),
),
],
),
),
const NewNFTWidget(),
],
);
}

@override
void dispose() {
_locationTimer?.cancel();
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/mint_nft/submit_nft_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:tree_planting_protocol/utils/constants/ui/color_constants.dart';
import 'package:tree_planting_protocol/widgets/basic_scaffold.dart';
import 'package:tree_planting_protocol/widgets/nft_display_utils/tree_nft_view_details_with_map.dart';
import 'package:tree_planting_protocol/utils/logger.dart';
import 'package:tree_planting_protocol/utils/services/contract_write_functions.dart';
import 'package:tree_planting_protocol/utils/services/contract_functions/tree_nft_contract/tree_nft_contract_write_functions.dart';

class SubmitNFTPage extends StatefulWidget {
const SubmitNFTPage({super.key});
Expand Down
Loading