问题描述
我在哪里可以获得关于 solidity 这个奇怪任务的详细解释?
构造函数中的那个。多个====.
在官方文档中找不到任何内容。
{
"Subscriptions": [
{
"SubscriptionArn": "arn:aws:sns:us-east-1:xxxxxxx:qwertyuuyt:ccffgv-e904-4f68-9a8f-vvggbb","Owner": "xxxxxxx","Protocol": "email","Endpoint": "qwerty@amazon.com","TopicArn": "arn:aws:sns:us-east-1:xxxxxxx:qwertyuuyt"
},{
"SubscriptionArn": "PendingConfirmation","Endpoint": "qwer@amazo.com","Endpoint": "qwettet@amazn.com","TopicArn": "arn:aws:sns:us-east-1:xxxxxxx:qwertyuuyt"
}`cv`
]
}
解决方法
这是 chained assignment 的一个示例,可在许多其他编程语言中使用。
JS 示例:
// copy paste this to your browser devtools console to explore how it works
let _initialSupply = 5;
let _anotherUint = 10;
let anotherUint;
let totalSupply;
const balance = totalSupply = anotherUint = _initialSupply = _anotherUint;
它分配:
-
_anotherUint
到_initialSupply
的值(覆盖构造函数中传递的值) -
_initialSupply
到anotherUint
的(新)值 -
anotherUint
到totalSupply
的值 - 最后是
totalSupply
的值到balances[msg.sender]
(或在我的 JS 代码中到balance
)
Solidity 文档似乎没有涵盖这个主题,但它并不只对 Solidity 明确。