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

smart contract #638

Merged
merged 24 commits into from
Oct 10, 2024
Merged

smart contract #638

merged 24 commits into from
Oct 10, 2024

Conversation

CoderZhi
Copy link
Collaborator

Smart contracts for miner, dao, task assignment, and etc


function withhold(address token, address owner, uint256 amount) external onlyOperator {
require(token != address(0), "reward token not set");
require(balances[token][owner] - withholdings[token][owner] >= amount, "insufficient balance");
Copy link
Member

Choose a reason for hiding this comment

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

“- withholdings[token][owner] ”Is it necessary

}

function setRewardToken(uint256 _id, address _rewardToken) external {
require(IProject(project).ownerOf(_id) != msg.sender, "invalid project");
Copy link
Member

Choose a reason for hiding this comment

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

==

emit Redeemed(token, _owner, _amount);
}

function withdraw(address _token, uint256 _amount) external {
Copy link
Member

Choose a reason for hiding this comment

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

does the withdrawal operation require certain permissions?

@huangzhiran huangzhiran merged commit 946e78b into develop Oct 10, 2024
6 checks passed
@huangzhiran huangzhiran deleted the minter branch October 10, 2024 08:10
@huangzhiran huangzhiran restored the minter branch October 12, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants