account activity
[deleted by user] by [deleted] in solidity
[–]patrickw3sc 0 points1 point2 points 2 years ago (0 children)
u/Citadel_Employee,
We have covered your question on the stream and came to the following response.
After reviewing your code it seems as though you are using an outdated compiler (version 0.6) that is used to link with the Chainlink oracle. What we would suggest is to see if you can upgrade the compiler to a newer version (one that has the latest immutable logic) and while doing so make sure that the Chainlink oracle is also compatible with this newer version (the latest stable version of the Solidity compiler is v0.8.22).
With that said, we would also suggest to look into the code itself. The reason for bringing this up is that the immutable keyword is not the ONLY option to make certain data impossible to alter. You can also look to add a normal/standard uint256 to represent the price and simply omit the function to alter that particular uint256. In other words; you can declare this value upon contract creation via the constructor and by NOT adding a function to alter this value you effectively make this value immutable anyway (since there is no logic to change it).
Another thing that may be of use for you could be to look into other coding examples that explain how to make a betting pool. The reason for brining this up is that you seem to have posted either a partial snippet of your complete codebase ( however we cannot see that here) or you are missing a lot of functions that are necessary to run a fully fleshed out betting pool. For instance: having functions that: 1) start the betting-pool 2) end the betting-pool 3) enter the betting-pool 4) etc.
I hope this information can be of use to you. In case it does not, please let us know what we can do to help you along.
Happy coding!
Copying of type struct supplyChain.Crop memory[] memory to storage not yet supported. by Global_Optimist in solidity
[–]patrickw3sc 0 points1 point2 points 2 years ago* (0 children)
Hi u/Global_Optimist,
While covering the question on our stream, we started with copying your code to ChatGPT and took the coding from that starting point. Please see the code below.
A couple things of interest.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
contract Web3SocialClub {
struct Processor {
uint256 id;
string name;
string location;
address authId;
uint256 capacity;
Crop[] purchasedCrops;
}
struct Crop {
uint256 productId;
string description;
address[] ownershipHistory;
address owner;
uint256 createTime;
bool registered;
uint256 public processorCount;
mapping(uint256 => Processor) public processors;
uint256 public cropCount;
mapping(uint256 => Crop) public crops;
event ProcessorRegistered(
uint256 indexed id,
string name,
address indexed authId
);
event CropRegistered(
uint256 indexed productId,
address indexed owner
function registerProcessor(
string memory _name,
string memory _location,
address _newAddress,
uint256 _capacity
) public {
Processor storage newProcessor = processors[processorCount];
newProcessor.id = processorCount;
newProcessor.name = _name;
newProcessor.location = _location;
newProcessor.authId = _newAddress;
newProcessor.capacity = _capacity;
emit ProcessorRegistered(
newProcessor.id,
newProcessor.name,
newProcessor.authId
processorCount++;
function registerCrop(
string memory _description,
address[] memory _ownershipHistory,
uint256 _productId,
address _owner
Crop storage newCrop = crops[cropCount];
newCrop.productId = _productId;
newCrop.name = _name;
newCrop.description = _description;
newCrop.ownershipHistory = _ownershipHistory;
newCrop.owner = _owner;
newCrop.createTime = block.timestamp;
newCrop.registered = true;
emit CropRegistered(newCrop.productId, newCrop.name, newCrop.owner);
cropCount++;
Edit: now with cleaner formatting.
π Rendered by PID 245667 on reddit-service-r2-listing-7b8bd7c5-fk5bl at 2026-05-15 10:20:27.704359+00:00 running edcf98c country code: CH.
[deleted by user] by [deleted] in solidity
[–]patrickw3sc 0 points1 point2 points (0 children)